From 0b0a00cc0551b7f525515e4e53bc0a11bd1b2ebd Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Thu, 20 Dec 2018 10:18:45 -0600 Subject: new --static-root-path flag for controlling static file locations --- src/doc/rustdoc/src/unstable-features.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/doc/rustdoc') diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 43cdab27e9d..905b0646534 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -402,3 +402,18 @@ Using `index-page` option enables `enable-index-page` option as well. ### `--enable-index-page`: generate a default index page for docs This feature allows the generation of a default index-page which lists the generated crates. + +### `--static-root-path`: control how static files are loaded in HTML output + +Using this flag looks like this: + +```bash +$ rustdoc src/lib.rs -Z unstable-options --static-root-path '/cache/' +``` + +This flag controls how rustdoc links to its static files on HTML pages. If you're hosting a lot of +crates' docs generated by the same version of rustdoc, you can use this flag to cache rustdoc's CSS, +JavaScript, and font files in a single location, rather than duplicating it once per "doc root" +(grouping of crate docs generated into the same output directory, like with `cargo doc`). Per-crate +files like the search index will still load from the documentation root, but anything that gets +renamed with `--resource-suffix` will load from the given path. -- cgit 1.4.1-3-g733a5