Skip to content

Commit dc6121c

Browse files
committed
Auto merge of #79642 - ijackson:default-theme-stab, r=jyn514
rustdoc: stabilise --default-theme command line option 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.) There is also a commit to do some minor grammar fixes to the help message.
2 parents 1d517af + 63f3876 commit dc6121c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/doc/rustdoc/src/command-line-arguments.md

+20
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,26 @@ for a target triple that's different than your host triple.
237237

238238
All of the usual caveats of cross-compiling code apply.
239239

240+
## `--default-theme`: set the default theme
241+
242+
Using this flag looks like this:
243+
244+
```bash
245+
$ rustdoc src/lib.rs --default-theme=ayu
246+
```
247+
248+
Sets the default theme (for users whose browser has not remembered a
249+
previous theme selection from the on-page theme picker).
250+
251+
The supplied value should be the lowercase version of the theme name.
252+
The set of available themes can be seen in the theme picker in the
253+
generated output.
254+
255+
Note that the set of available themes - and their appearance - is not
256+
necessarily stable from one rustdoc version to the next. If the
257+
requested theme does not exist, the builtin default (currently
258+
`light`) is used instead.
259+
240260
## `--markdown-css`: include more CSS files when rendering markdown
241261

242262
Using this flag looks like this:

src/librustdoc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ fn opts() -> Vec<RustcOptGroup> {
263263
"sort modules by where they appear in the program, rather than alphabetically",
264264
)
265265
}),
266-
unstable("default-theme", |o| {
266+
stable("default-theme", |o| {
267267
o.optopt(
268268
"",
269269
"default-theme",
270270
"Set the default theme. THEME should be the theme name, generally lowercase. \
271271
If an unknown default theme is specified, the builtin default is used. \
272-
The set of themes, and the rustdoc built-in default is not stable.",
272+
The set of themes, and the rustdoc built-in default, are not stable.",
273273
"THEME",
274274
)
275275
}),

0 commit comments

Comments
 (0)