Skip to content

Commit 10e6ca6

Browse files
Apply review comments
1 parent ca64df5 commit 10e6ca6

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ $ rustdoc src/lib.rs --themes /path/to/your/theme/file.css
371371
### `theme-checker`: check if your themes implement all the required rules
372372

373373
This flag allows you to check if your themes implement the necessary CSS rules. To put it more
374-
simply, when adding a new theme, it needs to implements all the CSS rules present in the `ðark` and
375-
`light` CSS themes.
374+
simply, when adding a new theme, it needs to implements all the CSS rules present in the "light"
375+
CSS theme.
376376

377377
You can use this flag like this:
378378

src/librustdoc/config.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,15 @@ impl Options {
372372
return Err(1);
373373
}
374374
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
375-
if !success || !ret.is_empty() {
376-
diag.struct_warn(&format!("invalid theme: \"{}\"", theme_s))
377-
.help("check what's wrong with the --theme-checker option")
375+
if !success {
376+
diag.struct_warn(&format!("error loading theme file: \"{}\"", theme_s)).emit();
377+
return Err(1);
378+
} else if !ret.is_empty() {
379+
diag.struct_warn(&format!("theme file \"{}\" is missing CSS rules from the \
380+
default theme", theme_s))
381+
.warn("the theme may appear incorrect when loaded")
382+
.help(&format!("to see what rules are missing, call `rustdoc \
383+
--theme-checker \"{}\"`", theme_s))
378384
.emit();
379385
}
380386
themes.push(theme_file);

0 commit comments

Comments
 (0)