-
Notifications
You must be signed in to change notification settings - Fork 116
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
[Feature] Add svg and gif support for DocC image(SR-15311) #4
Conversation
Which one should we use for gif's MIME type? "image/gif" or "application/octet-stream" "image/gif" in https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types "application/octet-stream" in FileRequestHandlerTests.swift swift-docc/Tests/SwiftDocCUtilitiesTests/PreviewServer/RequestHandler/FileRequestHandlerTests.swift Lines 73 to 81 in ff972f1
|
Thanks for opening this PR. This test should verify that the MIME type is “image/gif”. The “application/octet-stream” value is a general binary data file or an unknown file type but “image/gif” is more precise here. The rest of these changes look good to me. |
Change “application/octet-stream” to "image/gif" and pass the test. Any other suggestion? |
@swift-ci Please smoke test |
@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.
Thanks, this looks good to me. I will merge this after the CI passes.
The Linux test fail seem to a Swift bug on the development branch. |
It seems to be a bug on Swift Complier on Linux. And the CI Test on swift-markdown is missing, so we did not find it early. Also the 2021-10-05 snapshot of swift is working both on Linux and macOS.(For the success of building swift-markdown) Bug created at https://bugs.swift.org/browse/SR-15362 |
@swift-ci test |
The bug has been fixed on the main branch of Swift, but the latest snapshot has not updated yet. Can we merge it as it pass the macOS Platform test or do we need wait until there is a new snapshot released and pass the Linux Platform test? |
A successful build on macOS and Linux are required to merge, so we'll wait for the fix for https://bugs.swift.org/browse/SR-15362 to land in a toolchain. |
The new toolchain is landed, could you please make the ci-bots to test again? |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Feature/SR-15311
Summary
Swift-DocC currently ignores SVG and GIF files.
This PR add support for recognizing them as images in the same we do for JPEG, JPG, and PNG files.
Testing
Steps:
@Image(source: slothcreator-intro.png, alt: "An illustration of ... tutorials.")
to
@Image(source: xx.svg, alt: "An illustration of ... tutorials.")
@Image(source: xx.gif, alt: "An illustration of ... tutorials.")
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded