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

rustdoc: allow fully-local favicons and logos #102083

Closed
jsha opened this issue Sep 21, 2022 · 2 comments
Closed

rustdoc: allow fully-local favicons and logos #102083

jsha opened this issue Sep 21, 2022 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Sep 21, 2022

@Nemo157 pointed out at rust-lang/docs.rs#1853 (comment) that rustdoc offers two attributes, html_logo_url, and html_favicon_url, which are commonly used to embed image tags pointing to URLs on a different site than the documentation is served on:

https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_logo_url
https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_favicon_url

For reasons of privacy, performance, and offline access, it would be nice if this attribute could point at a file shipped with the crate itself, and copied from there into the documentation.

Proposal: if one of these attributes contains a URL that does not start with http:, https: or /, rustdoc should treat it as a file path relative to the crate root. Rustdoc should copy that file into the doc directory, and generate documentation that references the local file for the logo/favicon.

One downside: this means every download of the crate source for builds also has to download the logo and favicon, which are only needed for documentation.

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Sep 21, 2022
@GuillaumeGomez
Copy link
Member

I think this is a duplicate of #79254 and of #32104.

@jsha
Copy link
Contributor Author

jsha commented Sep 21, 2022

Indeed! Closing in favor of those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants