Create RFC for bundling local images in rustdoc output#3
Closed
GuillaumeGomez wants to merge 13 commits intomasterfrom
Closed
Create RFC for bundling local images in rustdoc output#3GuillaumeGomez wants to merge 13 commits intomasterfrom
GuillaumeGomez wants to merge 13 commits intomasterfrom
Conversation
6af79df to
6ac27fa
Compare
notriddle
reviewed
Feb 6, 2023
notriddle
reviewed
Feb 10, 2023
Nemo157
reviewed
Feb 13, 2023
notriddle
reviewed
Feb 13, 2023
jyn514
reviewed
Feb 13, 2023
* Add new entry for foreign items inlining. * Mention problem of packages size increase * Add unresolved questions about support for logo and favicon
…on this RFC * Change how cross-crate inlining will be handled
notriddle
reviewed
Feb 15, 2023
notriddle
reviewed
Feb 15, 2023
|
|
||
| The only local resources considered will be the ones in the markdown image syntax: ``, where `<path>` is the path of the resource file relative to the source file. | ||
|
|
||
| The path could be either a relative path (`../images/my_image.png`) or an absolute path (like `/home/user/project/images/my_image.png` or `C:/Users/user/project/images/my_image.png`) so that paths can be constructed using `OUT_DIR`: |
There was a problem hiding this comment.
After the confusion in Zulip, this probably needs to be a bit more explicit about the motivation here:
Suggested change
| The path could be either a relative path (`../images/my_image.png`) or an absolute path (like `/home/user/project/images/my_image.png` or `C:/Users/user/project/images/my_image.png`) so that paths can be constructed using `OUT_DIR`: | |
| The path could be any relative or absolute file path. For example, to include an image generated by [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html), concatenate a path with the `OUT_DIR` environment variable: |
|
|
||
| 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. | ||
|
|
||
| For published crates, <docs.rs> builds the contents of the `.crate` package in a sandbox with no internet access. Make sure any resources your docs need are [included](https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields) in the package. |
There was a problem hiding this comment.
Suggested change
| For published crates, <docs.rs> builds the contents of the `.crate` package in a sandbox with no internet access. Make sure any resources your docs need are [included](https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields) in the package. | |
| For published crates, [docs.rs] builds the contents of the `.crate` package in a sandbox with no internet access. Make sure any resources your docs need are [included](https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields) in the package. |
|
|
||
| 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. |
There was a problem hiding this comment.
Suggested change
| 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. | |
| 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. |
Owner
Author
|
I fixed the links and added the explanation for cross-crate inlined images. |
8b0cdb8 to
b1203a5
Compare
notriddle
approved these changes
Feb 23, 2023
This file contains hidden or 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
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.
rendered