-
Notifications
You must be signed in to change notification settings - Fork 60
Add support for @Video
directive
#407
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 support for @Video
directive
#407
Conversation
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.
I think we should mark this PR as a draft until the two dependent PRs have been merged, and this has been rebased.
Yes, I just wanted to get things rolling. |
e776478
to
ccd67d2
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
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.
Looks good and is working with the DocC branch.
My only minor concern is that the "Play" icon is the same icon as the "Replay" icon, which is a little bit odd. I would probably actually prefer that we just use the normal video controls and remove the play/replay link entirely, but you may want to discuss with the design team.
Also, make sure to rebase this against the main branch once the 3 dependent PRs have been merged (the replay one, the image one, and the figure caption one) before merging this one.
95cabaf
to
05e58d3
Compare
@swift-ci test |
You have a point Marcus, I changed that because it's a good point anyway. I will check with Design if they want me to just show full native controls all the time, instead of just on mobile devices. I think we discussed that we may want just the minimal UI of the tutorials. |
@swift-ci test |
# Conflicts: # src/components/ContentNode.vue # tests/unit/components/ContentNode.spec.js
@swift-ci test |
@swift-ci test |
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
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
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
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
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
Bug/issue #, if applicable: 97715316
Summary
Add support for DocC
@Video
directive in Documentation pages.Dependencies
This PR extends the work done the PRs below, and should be rebased after they are merged into
main
.#404
#406
DocC PR - swiftlang/swift-docc#381
Testing
We need proper DocC support to be able to test this out, but you can add this JSON to the
content
of a random RenderJSON file from a doccarchive, and it should work:Video JSON
Reference JSON inside
references
Steps:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded