diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 45106c5dbf6a..2558f9e0d789 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -378,6 +378,17 @@ impl Options { }; let mut default_settings: Vec> = vec![ + matches + .opt_str("default-theme") + .iter() + .map(|theme| { + vec![ + ("use-system-theme".to_string(), "false".to_string()), + ("theme".to_string(), theme.to_string()), + ] + }) + .flatten() + .collect(), matches .opt_strs("default-setting") .iter() diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 90c77488ee94..54463d5c3758 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -269,6 +269,16 @@ fn opts() -> Vec { "sort modules by where they appear in the program, rather than alphabetically", ) }), + unstable("default-theme", |o| { + o.optopt( + "", + "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.", + "THEME", + ) + }), unstable("default-setting", |o| { o.optmulti( "",