rustdoc: allow fully-local favicons and logos #102083
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.
@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.
The text was updated successfully, but these errors were encountered: