about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-03-30 01:31:12 +0200
committerGitHub <noreply@github.com>2018-03-30 01:31:12 +0200
commiteb3e2feb0d2de2b9e54a51216f0c53c7962cfc10 (patch)
treefbe24106091c1beee686f4e16c7daea2a6a433ee
parent3d316a55159ede0c6408826989735559905435fc (diff)
parent772a8028ffbb3386d8da8cf5a17517b453eed767 (diff)
downloadrust-eb3e2feb0d2de2b9e54a51216f0c53c7962cfc10.tar.gz
rust-eb3e2feb0d2de2b9e54a51216f0c53c7962cfc10.zip
Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus
Rename main theme into light theme

r? @QuietMisdreavus
-rw-r--r--src/doc/rustdoc/src/unstable-features.md6
-rw-r--r--src/librustdoc/html/layout.rs2
-rw-r--r--src/librustdoc/html/render.rs12
-rw-r--r--src/librustdoc/html/static/storage.js2
-rw-r--r--src/librustdoc/html/static/themes/light.css (renamed from src/librustdoc/html/static/themes/main.css)0
-rw-r--r--src/librustdoc/lib.rs8
-rw-r--r--src/tools/error_index_generator/main.rs4
-rw-r--r--src/tools/rustdoc-themes/main.rs2
8 files changed, 18 insertions, 18 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md
index 16356c20c70..44b9145a8c2 100644
--- a/src/doc/rustdoc/src/unstable-features.md
+++ b/src/doc/rustdoc/src/unstable-features.md
@@ -305,7 +305,7 @@ $ rustdoc src/lib.rs -Z unstable-options --themes theme.css
 
 Giving this flag to `rustdoc` will make it copy your theme into the generated crate docs and enable
 it in the theme selector. Note that `rustdoc` will reject your theme file if it doesn't style
-everything the "main" theme does. See `--theme-checker` below for details.
+everything the "light" theme does. See `--theme-checker` below for details.
 
 ### `--theme-checker`: verify theme CSS for validity
 
@@ -316,7 +316,7 @@ $ rustdoc -Z unstable-options --theme-checker theme.css
 ```
 
 Before including your theme in crate docs, `rustdoc` will compare all the CSS rules it contains
-against the "main" theme included by default. Using this flag will allow you to see which rules are
+against the "light" theme included by default. Using this flag will allow you to see which rules are
 missing if `rustdoc` rejects your theme.
 
 ### `--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
 When rendering docs, `rustdoc` creates several CSS and JavaScript files as part of the output. Since
 all these files are linked from every page, changing where they are can be cumbersome if you need to
 specially cache them. This flag will rename all these files in the output to include the suffix in
-the filename. For example, `main.css` would become `main-suf.css` with the above command.
+the filename. For example, `light.css` would become `light-suf.css` with the above command.
 
 ### `--display-warnings`: display warnings when documenting or running documentation tests
 
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs
index 0151a8c3ab7..aac5d0d2601 100644
--- a/src/librustdoc/html/layout.rs
+++ b/src/librustdoc/html/layout.rs
@@ -53,7 +53,7 @@ r##"<!DOCTYPE html>
           id="mainThemeStyle">
     {themes}
     <link rel="stylesheet" type="text/css" href="{root_path}dark{suffix}.css">
-    <link rel="stylesheet" type="text/css" href="{root_path}main{suffix}.css" id="themeStyle">
+    <link rel="stylesheet" type="text/css" href="{root_path}light{suffix}.css" id="themeStyle">
     <script src="{root_path}storage{suffix}.js"></script>
     {css_extension}
 
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 2eee60890e8..30f95e36f69 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -129,8 +129,8 @@ pub struct SharedContext {
     pub sort_modules_alphabetically: bool,
     /// Additional themes to be added to the generated docs.
     pub themes: Vec<PathBuf>,
-    /// Suffix to be added on resource files (if suffix is "-v2" then "main.css" becomes
-    /// "main-v2.css").
+    /// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
+    /// "light-v2.css").
     pub resource_suffix: String,
 }
 
@@ -743,7 +743,7 @@ fn write_shared(cx: &Context,
     write(cx.dst.join(&format!("rustdoc{}.css", cx.shared.resource_suffix)),
           include_bytes!("static/rustdoc.css"))?;
 
-    // To avoid "main.css" to be overwritten, we'll first run over the received themes and only
+    // To avoid "light.css" to be overwritten, we'll first run over the received themes and only
     // then we'll run over the "official" styles.
     let mut themes: HashSet<String> = HashSet::new();
 
@@ -761,9 +761,9 @@ fn write_shared(cx: &Context,
 
     write(cx.dst.join(&format!("brush{}.svg", cx.shared.resource_suffix)),
           include_bytes!("static/brush.svg"))?;
-    write(cx.dst.join(&format!("main{}.css", cx.shared.resource_suffix)),
-          include_bytes!("static/themes/main.css"))?;
-    themes.insert("main".to_owned());
+    write(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
+          include_bytes!("static/themes/light.css"))?;
+    themes.insert("light".to_owned());
     write(cx.dst.join(&format!("dark{}.css", cx.shared.resource_suffix)),
           include_bytes!("static/themes/dark.css"))?;
     themes.insert("dark".to_owned());
diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/storage.js
index c8571e4cf91..2f4e203ebc5 100644
--- a/src/librustdoc/html/static/storage.js
+++ b/src/librustdoc/html/static/storage.js
@@ -67,4 +67,4 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
     }
 }
 
-switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'main');
+switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light');
diff --git a/src/librustdoc/html/static/themes/main.css b/src/librustdoc/html/static/themes/light.css
index 2334a272855..2334a272855 100644
--- a/src/librustdoc/html/static/themes/main.css
+++ b/src/librustdoc/html/static/themes/light.css
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 0339a58d582..66369e86006 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -267,8 +267,8 @@ pub fn opts() -> Vec<RustcOptGroup> {
         unstable("resource-suffix", |o| {
             o.optopt("",
                      "resource-suffix",
-                     "suffix to add to CSS and JavaScript files, e.g. \"main.css\" will become \
-                      \"main-suffix.css\"",
+                     "suffix to add to CSS and JavaScript files, e.g. \"light.css\" will become \
+                      \"light-suffix.css\"",
                      "PATH")
         }),
     ]
@@ -322,7 +322,7 @@ pub fn main_args(args: &[String]) -> isize {
 
     let to_check = matches.opt_strs("theme-checker");
     if !to_check.is_empty() {
-        let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
+        let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
         let mut errors = 0;
 
         println!("rustdoc: [theme-checker] Starting tests!");
@@ -393,7 +393,7 @@ pub fn main_args(args: &[String]) -> isize {
 
     let mut themes = Vec::new();
     if matches.opt_present("themes") {
-        let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
+        let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
 
         for (theme_file, theme_s) in matches.opt_strs("themes")
                                             .iter()
diff --git a/src/tools/error_index_generator/main.rs b/src/tools/error_index_generator/main.rs
index cdeb6015672..ade7ae0a4ae 100644
--- a/src/tools/error_index_generator/main.rs
+++ b/src/tools/error_index_generator/main.rs
@@ -61,8 +61,8 @@ impl Formatter for HTMLFormatter {
 <head>
 <title>Rust Compiler Error Index</title>
 <meta charset="utf-8">
-<!-- Include rust.css after main.css so its rules take priority. -->
-<link rel="stylesheet" type="text/css" href="main.css"/>
+<!-- Include rust.css after light.css so its rules take priority. -->
+<link rel="stylesheet" type="text/css" href="light.css"/>
 <link rel="stylesheet" type="text/css" href="rust.css"/>
 <style>
 .error-undescribed {{
diff --git a/src/tools/rustdoc-themes/main.rs b/src/tools/rustdoc-themes/main.rs
index 4028cb4e8b6..c8fb65e9a2a 100644
--- a/src/tools/rustdoc-themes/main.rs
+++ b/src/tools/rustdoc-themes/main.rs
@@ -13,7 +13,7 @@ use std::fs::read_dir;
 use std::path::Path;
 use std::process::{Command, exit};
 
-const FILES_TO_IGNORE: &[&str] = &["main.css"];
+const FILES_TO_IGNORE: &[&str] = &["light.css"];
 
 fn get_folders<P: AsRef<Path>>(folder_path: P) -> Vec<String> {
     let mut ret = Vec::with_capacity(10);