From cb2619fa9b6248c779b4b4dd8d4e65fb0b0c61d2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 6 Feb 2023 17:32:23 +0100 Subject: [PATCH 1/3] Create RFC for bundling local images in rustdoc output --- text/000-rustdoc-bundle-local-resources.md | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 text/000-rustdoc-bundle-local-resources.md diff --git a/text/000-rustdoc-bundle-local-resources.md b/text/000-rustdoc-bundle-local-resources.md new file mode 100644 index 00000000000..28a3a77e3c6 --- /dev/null +++ b/text/000-rustdoc-bundle-local-resources.md @@ -0,0 +1,117 @@ +Rustdoc: Bundle local images + +- Feature Name: NONE +- Start Date: 2023-02-06 +- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000) +- Rust Issue: [rust-lang/rust#32104](https://github.com/rust-lang/rust/issues/32104) + +# Summary +[summary]: #summary + +This RFC proposes to allow the bundling of local images in rustdoc HTML output. A draft implementation is available as [#107640](https://github.com/rust-lang/rust/pull/107640). + +# Motivation +[motivation]: #motivation + +Doc authors want to produce docs that are consistent across local `cargo doc` output, `docs.rs`, and self-hosted docs. They would also like to include images (like logos and diagrams), and scripts (like KaTeX for rendering math symbols). Both doc authors and doc readers would like for those resources to not be subject to link-rot, which means it should be possible to build docs for an old version of a crate and have the images and scripts reliably available. Doc readers would like for `cargo doc` output to be rendered correctly by their browsers even when they are offline. + +Right now, there are attributes that can set a logo and a favicon for documentation, but they must to point to an absolute URL, which prevents bundling the logo and favicon in the source repository. Also, while `