### `theme-checker`: check if your themes implement all the required rules
This flag allows you to check if your themes implement the necessary CSS rules. To put it more
-simply, when adding a new theme, it needs to implements all the CSS rules present in the `ðark` and
-`light` CSS themes.
+simply, when adding a new theme, it needs to implements all the CSS rules present in the "light"
+CSS theme.
You can use this flag like this:
return Err(1);
}
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
- if !success || !ret.is_empty() {
- diag.struct_warn(&format!("invalid theme: \"{}\"", theme_s))
- .help("check what's wrong with the --theme-checker option")
+ if !success {
+ diag.struct_warn(&format!("error loading theme file: \"{}\"", theme_s)).emit();
+ return Err(1);
+ } else if !ret.is_empty() {
+ diag.struct_warn(&format!("theme file \"{}\" is missing CSS rules from the \
+ default theme", theme_s))
+ .warn("the theme may appear incorrect when loaded")
+ .help(&format!("to see what rules are missing, call `rustdoc \
+ --theme-checker \"{}\"`", theme_s))
.emit();
}
themes.push(theme_file);