From 25740fc6823ee3901e5917869b1f1ae1b4373c5e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Dec 2020 18:31:55 +0000 Subject: [PATCH 1/4] rustdoc: --default-theme: minor grammar fix to usage message Signed-off-by: Ian Jackson --- src/librustdoc/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 751f230105392..951bb27a9fafd 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -275,7 +275,7 @@ fn opts() -> Vec { "default-theme", "Set the default theme. THEME should be the theme name, generally lowercase. \ If an unknown default theme is specified, the builtin default is used. \ - The set of themes, and the rustdoc built-in default is not stable.", + The set of themes, and the rustdoc built-in default, are not stable.", "THEME", ) }), From 36ee3bde07093ac81f9be113000df69c79c1afca Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Dec 2020 18:32:38 +0000 Subject: [PATCH 2/4] rustdoc: stabilise --default-theme As discussed in #77213, this seems like it has bedded in and can be safely and usefully made stable. (rustdoc already has other stable options that interact quite intimately with the rustdoc-supplied CSS, and also an option for supplying entirely different CSS, so exposing the theme names this way seems a very minor step.) Signed-off-by: Ian Jackson --- src/librustdoc/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 951bb27a9fafd..83d2c2d894bf7 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -269,7 +269,7 @@ fn opts() -> Vec { "sort modules by where they appear in the program, rather than alphabetically", ) }), - unstable("default-theme", |o| { + stable("default-theme", |o| { o.optopt( "", "default-theme", From c21b275d35bbc624ad5859d69ae5172464fd66e8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 3 Dec 2020 00:23:01 +0000 Subject: [PATCH 3/4] rustdoc: document --default-theme option in command line doc Signed-off-by: Ian Jackson --- src/doc/rustdoc/src/command-line-arguments.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index 31e002810ce4b..faf22296b5dab 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -237,6 +237,26 @@ for a target triple that's different than your host triple. All of the usual caveats of cross-compiling code apply. +## `--default-theme`: set the default theme + +Using this flag looks like this: + +```bash +$ rustdoc src/lib.rs --default-theme=ayu +``` + +Sets the default theme (for users whose browser has not remembered a +previous theme selection from the on-page theme picker). + +The supplied value should be the lowercase version of the theme name. +The set of available themes can be seen in the theme picker in the +gneerated output. + +Note that the set of available themes - and their appearance - is not +necessarily stable from one rustdoc version to the next. If the +requested theme does not exist, the builtin default (currently +`light`) is used instead. + ## `--markdown-css`: include more CSS files when rendering markdown Using this flag looks like this: From 63f3876b856e8e995d2b4960ca9f6f617950ce7b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 3 Dec 2020 10:22:57 +0000 Subject: [PATCH 4/4] fix typo in src/doc/rustdoc/src/command-line-arguments.md Co-authored-by: Guillaume Gomez --- src/doc/rustdoc/src/command-line-arguments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index faf22296b5dab..80f7851debfbd 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -250,7 +250,7 @@ previous theme selection from the on-page theme picker). The supplied value should be the lowercase version of the theme name. The set of available themes can be seen in the theme picker in the -gneerated output. +generated output. Note that the set of available themes - and their appearance - is not necessarily stable from one rustdoc version to the next. If the