Skip to content

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed
 

‎src/doc/rustdoc/src/unstable-features.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ $ rustdoc src/lib.rs -Z unstable-options --themes theme.css
305305

306306
Giving this flag to `rustdoc` will make it copy your theme into the generated crate docs and enable
307307
it in the theme selector. Note that `rustdoc` will reject your theme file if it doesn't style
308-
everything the "main" theme does. See `--theme-checker` below for details.
308+
everything the "light" theme does. See `--theme-checker` below for details.
309309

310310
### `--theme-checker`: verify theme CSS for validity
311311

@@ -316,7 +316,7 @@ $ rustdoc -Z unstable-options --theme-checker theme.css
316316
```
317317

318318
Before including your theme in crate docs, `rustdoc` will compare all the CSS rules it contains
319-
against the "main" theme included by default. Using this flag will allow you to see which rules are
319+
against the "light" theme included by default. Using this flag will allow you to see which rules are
320320
missing if `rustdoc` rejects your theme.
321321

322322
### `--resource-suffix`: modifying the name of CSS/JavaScript in crate docs
@@ -330,7 +330,7 @@ $ rustdoc src/lib.rs -Z unstable-options --resource-suffix suf
330330
When rendering docs, `rustdoc` creates several CSS and JavaScript files as part of the output. Since
331331
all these files are linked from every page, changing where they are can be cumbersome if you need to
332332
specially cache them. This flag will rename all these files in the output to include the suffix in
333-
the filename. For example, `main.css` would become `main-suf.css` with the above command.
333+
the filename. For example, `light.css` would become `light-suf.css` with the above command.
334334

335335
### `--display-warnings`: display warnings when documenting or running documentation tests
336336

‎src/librustdoc/html/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ r##"<!DOCTYPE html>
5353
id="mainThemeStyle">
5454
{themes}
5555
<link rel="stylesheet" type="text/css" href="{root_path}dark{suffix}.css">
56-
<link rel="stylesheet" type="text/css" href="{root_path}main{suffix}.css" id="themeStyle">
56+
<link rel="stylesheet" type="text/css" href="{root_path}light{suffix}.css" id="themeStyle">
5757
<script src="{root_path}storage{suffix}.js"></script>
5858
{css_extension}
5959

‎src/librustdoc/html/render.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ pub struct SharedContext {
129129
pub sort_modules_alphabetically: bool,
130130
/// Additional themes to be added to the generated docs.
131131
pub themes: Vec<PathBuf>,
132-
/// Suffix to be added on resource files (if suffix is "-v2" then "main.css" becomes
133-
/// "main-v2.css").
132+
/// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
133+
/// "light-v2.css").
134134
pub resource_suffix: String,
135135
}
136136

@@ -743,7 +743,7 @@ fn write_shared(cx: &Context,
743743
write(cx.dst.join(&format!("rustdoc{}.css", cx.shared.resource_suffix)),
744744
include_bytes!("static/rustdoc.css"))?;
745745

746-
// To avoid "main.css" to be overwritten, we'll first run over the received themes and only
746+
// To avoid "light.css" to be overwritten, we'll first run over the received themes and only
747747
// then we'll run over the "official" styles.
748748
let mut themes: HashSet<String> = HashSet::new();
749749

@@ -761,9 +761,9 @@ fn write_shared(cx: &Context,
761761

762762
write(cx.dst.join(&format!("brush{}.svg", cx.shared.resource_suffix)),
763763
include_bytes!("static/brush.svg"))?;
764-
write(cx.dst.join(&format!("main{}.css", cx.shared.resource_suffix)),
765-
include_bytes!("static/themes/main.css"))?;
766-
themes.insert("main".to_owned());
764+
write(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
765+
include_bytes!("static/themes/light.css"))?;
766+
themes.insert("light".to_owned());
767767
write(cx.dst.join(&format!("dark{}.css", cx.shared.resource_suffix)),
768768
include_bytes!("static/themes/dark.css"))?;
769769
themes.insert("dark".to_owned());

‎src/librustdoc/html/static/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
6767
}
6868
}
6969

70-
switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'main');
70+
switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light');

‎src/librustdoc/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ pub fn opts() -> Vec<RustcOptGroup> {
266266
unstable("resource-suffix", |o| {
267267
o.optopt("",
268268
"resource-suffix",
269-
"suffix to add to CSS and JavaScript files, e.g. \"main.css\" will become \
270-
\"main-suffix.css\"",
269+
"suffix to add to CSS and JavaScript files, e.g. \"light.css\" will become \
270+
\"light-suffix.css\"",
271271
"PATH")
272272
}),
273273
]
@@ -321,7 +321,7 @@ pub fn main_args(args: &[String]) -> isize {
321321

322322
let to_check = matches.opt_strs("theme-checker");
323323
if !to_check.is_empty() {
324-
let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
324+
let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
325325
let mut errors = 0;
326326

327327
println!("rustdoc: [theme-checker] Starting tests!");
@@ -392,7 +392,7 @@ pub fn main_args(args: &[String]) -> isize {
392392

393393
let mut themes = Vec::new();
394394
if matches.opt_present("themes") {
395-
let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
395+
let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
396396

397397
for (theme_file, theme_s) in matches.opt_strs("themes")
398398
.iter()

‎src/tools/error_index_generator/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl Formatter for HTMLFormatter {
6161
<head>
6262
<title>Rust Compiler Error Index</title>
6363
<meta charset="utf-8">
64-
<!-- Include rust.css after main.css so its rules take priority. -->
65-
<link rel="stylesheet" type="text/css" href="main.css"/>
64+
<!-- Include rust.css after light.css so its rules take priority. -->
65+
<link rel="stylesheet" type="text/css" href="light.css"/>
6666
<link rel="stylesheet" type="text/css" href="rust.css"/>
6767
<style>
6868
.error-undescribed {{

‎src/tools/rustdoc-themes/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fs::read_dir;
1313
use std::path::Path;
1414
use std::process::{Command, exit};
1515

16-
const FILES_TO_IGNORE: &[&str] = &["main.css"];
16+
const FILES_TO_IGNORE: &[&str] = &["light.css"];
1717

1818
fn get_folders<P: AsRef<Path>>(folder_path: P) -> Vec<String> {
1919
let mut ret = Vec::with_capacity(10);

0 commit comments

Comments
 (0)
Please sign in to comment.