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

Create RFC for bundling local images in rustdoc output #3

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion text/000-rustdoc-bundle-local-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Currently, rustdoc does not allow for the inclusion of local images in the gener

This would make the documentation more engaging and easier to understand while lowering the amount of effort required to achieve a better result.

# Guide-level explanationvide
# Guide-level explanation
[guide-level-explanation]: #guide-level-explanation

This RFC proposes to allow rustdoc to include local images in the generated documentation by copying them into the output directory.
Expand All @@ -37,8 +37,12 @@ The path could be either a relative path (`../images/my_image.png`) or an absolu

If the path isn't referring to a file, a warning will be emitted and rustdoc will left the path unchanged in the generated documentation.

Important to be noted for published crates: local resources need to be bundled with the crate so they can be retrieved by rustdoc and absolute paths won't work.
GuillaumeGomez marked this conversation as resolved.
Show resolved Hide resolved

The local resources files are not affected by the `--resource-suffix`.

The impact on `docs.rs` would also be very minimal as the size of a published crate resources is limited to a few megabytes. The only thing needed would be to handle the new `doc.files` folder.

# Reference-level explanation
[reference-level-explanation]: #reference-level-explanation

Expand Down