Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more documentation about the @Image source value #1167

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

d-ronnqvist
Copy link
Contributor

@d-ronnqvist d-ronnqvist commented Mar 6, 2025

Bug/issue #, if applicable: rdar://145303029

Summary

90543ce updates the @Image directive documentation to include more information about the format of the source parameter. Some of this information was already available in the Adding Images to Your Content article but some of it is specific to directive string parameters.

It also makes some minor clarifications and corrections this documentation:

  • Changing "code base" to "documentation catalog" to clarify where these images exist
  • Correcting that there's more than 4 possible combinations of appearance and display scale-aware variants for an image.
  • Updating some terminology to be consistent with the Adding Images to Your Content article
  • etc.

b3e0430 consistently omits unnecessary quotation marks and file extensions in @Image examples in other DocC documentation.

Dependencies

None

Testing

Locally build the DocCDocumentation.docc catalog and preview the @Image directive page.

Screenshot 2025-03-06 at 11 07 54

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [ ] Added tests Not applicable
  • [ ] Ran the ./bin/test script and it succeeded Not applicable
  • Updated documentation if necessary

Also, add some information from the images article to the @image directive documentation.

rdar://145303029
@d-ronnqvist d-ronnqvist added the documentation Improvements or additions to documentation label Mar 6, 2025
````

Images can exist anywhere in your code base, but it's good practice to centralize them in a resources folder. You create this folder in your documentation catalog. Within your code base, image names must be unique. Images must be in *.png*, *.jpg*, *.jpeg*, *.svg*, or *.gif* format.
Images can exist anywhere in your documentation catalog ('.docc' directory). but it's good practice to use subdirectories to organize the content and assets in your documentation.
Regardless of organization within your catalog, each image need to have a unique name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Regardless of organization within your catalog, each image need to have a unique name.
Regardless of organization within your catalog, each image needs to have a unique name.


- Tip: To differentiate tutorial images from reference documentation images, you may wish to prefix image file names with tutorial\.
- Tip: To differentiate tutorial images from reference documentation images, you may wish to prefix image file names with tutorial.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to differentiate the prefix with some sort of styling, such as quotes or code-styling

Suggested change
- Tip: To differentiate tutorial images from reference documentation images, you may wish to prefix image file names with tutorial.
- Tip: To differentiate tutorial images from reference documentation images, you may wish to prefix image file names with "tutorial".

Copy link
Contributor Author

@d-ronnqvist d-ronnqvist Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly wanted to remove the extra character on that line. I agree that quoting the the prefix would distinguish it better.

However, now that I read the tip more closely I feel like it's a bit silly and could maybe go away entirely.

Suggested change
- Tip: To differentiate tutorial images from reference documentation images, you may wish to prefix image file names with tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants