-
Notifications
You must be signed in to change notification settings - Fork 127
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 @Image and @Video directives to reference documentation with caption support #381
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
ethan-kusters
force-pushed
the
image-and-video
branch
from
September 14, 2022 13:26
118eac7
to
3aa1cd6
Compare
ethan-kusters
force-pushed
the
image-and-video
branch
2 times, most recently
from
September 16, 2022 10:52
57e28ad
to
fe0b43a
Compare
ethan-kusters
force-pushed
the
image-and-video
branch
3 times, most recently
from
October 1, 2022 09:09
a737dc5
to
01407b6
Compare
@swift-ci please test |
franklinsch
approved these changes
Oct 3, 2022
These changes look good to me. @Kyle-Ye I added you as a reviewer in case you want to take a look as well, since you've contributed to these areas in the past. |
Kyle-Ye
approved these changes
Oct 3, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Allows for other clients of image resolving to share this logic.
Currently we resolve and diagnose image references but include the `RenderInlineContent.image` regardless. This cleans up that behavior to only include it in the case where the image resolves.
Adds support for using the `@Image` and `@Video` directives from Tutorials in regular reference documentation. This allows authors to insert videos into documentation and to create images that have attached captions. To that point, the `@Image` and `@Video` directives can now contain inline text to form a caption. The final change here is that the `@Video` directive now supports alt text. Examples: @image(source: "overview-hero.png", alt: "An illustration of a sleeping sloth.") { This is a caption adding additional context for the image. } @video(source: "sloth-smiling.mp4", poster: "happy-sloth-frame.png", alt: "A short video of a sloth jumping down from a branch.") { A *happy* sloth. 🦥 } This change is described on the Swift forums here: https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#image-1 Dependencies: - swiftlang/swift-docc-render#407 - swiftlang/swift-docc-render#404 Resolves rdar://97739628
Adding support for `@Image` in regular prose surfaced a bug in `@Volume` where the remainder was not being properly tracked after parsing the required `@Image` child in a `@Volume`. Instead the `@Image` stayed around in the general prose content leading to rendering issues now that we support `@Image` there.
ethan-kusters
force-pushed
the
image-and-video
branch
from
October 3, 2022 12:58
01407b6
to
7dadeae
Compare
@swift-ci please test |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug/issue #, if applicable: rdar://97739628
Summary
Adds support for using the
@Image
and@Video
directives from Tutorialsin regular reference documentation. This allows authors to
insert videos into documentation and to create images that have
attached captions.
To that point, the
@Image
and@Video
directives can now containinline text to form a caption.
The final change here is that the
@Video
directive now supportsalt text.
Examples:
This change is described on the Swift forums here:
https://forums.swift.org/t/supporting-more-dynamic-content-in-swift-docc-reference-documentation/59527#image-1
Dependencies
@Image
directive swift-docc-render#404@Video
directive swift-docc-render#407Testing
Use
@Image
and@Video
in regular article content and confirm that work as expected.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded