]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static_files.rs
34055f386fbc048c91d6a539f3467d588f40252a
[rust.git] / src / librustdoc / html / static_files.rs
1 //! Static files bundled with documentation output.
2 //!
3 //! All the static files are included here for centralized access in case anything other than the
4 //! HTML rendering code (say, the theme checker) needs to access one of these files.
5 //!
6 //! Note about types: CSS and JavaScript files are included as `&'static str` to allow for the
7 //! minifier to run on them. All other files are included as `&'static [u8]` so they can be
8 //! directly written to a `Write` handle.
9
10 /// The file contents of the main `rustdoc.css` file, responsible for the core layout of the page.
11 pub static RUSTDOC_CSS: &'static str = include_str!("static/rustdoc.css");
12
13 /// The file contents of `settings.css`, responsible for the items on the settings page.
14 pub static SETTINGS_CSS: &'static str = include_str!("static/settings.css");
15
16 /// The file contents of the `noscript.css` file, used in case JS isn't supported or is disabled.
17 pub static NOSCRIPT_CSS: &'static str = include_str!("static/noscript.css");
18
19 /// The file contents of `normalize.css`, included to even out standard elements between browser
20 /// implementations.
21 pub static NORMALIZE_CSS: &'static str = include_str!("static/normalize.css");
22
23 /// The file contents of `main.js`, which contains the core JavaScript used on documentation pages,
24 /// including search behavior and docblock folding, among others.
25 pub static MAIN_JS: &'static str = include_str!("static/main.js");
26
27 /// The file contents of `settings.js`, which contains the JavaScript used to handle the settings
28 /// page.
29 pub static SETTINGS_JS: &'static str = include_str!("static/settings.js");
30
31 /// The file contents of `storage.js`, which contains functionality related to browser Local
32 /// Storage, used to store documentation settings.
33 pub static STORAGE_JS: &'static str = include_str!("static/storage.js");
34
35 /// The file contents of `brush.svg`, the icon used for the theme-switch button.
36 pub static BRUSH_SVG: &'static [u8] = include_bytes!("static/brush.svg");
37
38 /// The file contents of `wheel.svg`, the icon used for the settings button.
39 pub static WHEEL_SVG: &'static [u8] = include_bytes!("static/wheel.svg");
40
41 /// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox.
42 pub static DOWN_ARROW_SVG: &'static [u8] = include_bytes!("static/down-arrow.svg");
43
44 /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation
45 /// output.
46 pub static COPYRIGHT: &'static [u8] = include_bytes!("static/COPYRIGHT.txt");
47
48 /// The contents of `LICENSE-APACHE.txt`, the text of the Apache License, version 2.0.
49 pub static LICENSE_APACHE: &'static [u8] = include_bytes!("static/LICENSE-APACHE.txt");
50
51 /// The contents of `LICENSE-MIT.txt`, the text of the MIT License.
52 pub static LICENSE_MIT: &'static [u8] = include_bytes!("static/LICENSE-MIT.txt");
53
54 /// The contents of `rust-logo.png`, the default icon of the documentation.
55 pub static RUST_LOGO: &'static [u8] = include_bytes!("static/rust-logo.png");
56 /// The contents of `favicon.ico`, the default favicon of the documentation.
57 pub static RUST_FAVICON: &'static [u8] = include_bytes!("static/favicon.ico");
58
59 /// The built-in themes given to every documentation site.
60 pub mod themes {
61     /// The "light" theme, selected by default when no setting is available. Used as the basis for
62     /// the `--check-theme` functionality.
63     pub static LIGHT: &'static str = include_str!("static/themes/light.css");
64
65     /// The "dark" theme.
66     pub static DARK: &'static str = include_str!("static/themes/dark.css");
67 }
68
69 /// Files related to the Fira Sans font.
70 pub mod fira_sans {
71     /// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font.
72     pub static REGULAR: &'static [u8] = include_bytes!("static/FiraSans-Regular.woff");
73
74     /// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font.
75     pub static MEDIUM: &'static [u8] = include_bytes!("static/FiraSans-Medium.woff");
76
77     /// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font.
78     pub static LICENSE: &'static [u8] = include_bytes!("static/FiraSans-LICENSE.txt");
79 }
80
81 /// Files related to the Source Serif Pro font.
82 pub mod source_serif_pro {
83     /// The file `SourceSerifPro-Regular.ttf.woff`, the Regular variant of the Source Serif Pro
84     /// font.
85     pub static REGULAR: &'static [u8] = include_bytes!("static/SourceSerifPro-Regular.ttf.woff");
86
87     /// The file `SourceSerifPro-Bold.ttf.woff`, the Bold variant of the Source Serif Pro font.
88     pub static BOLD: &'static [u8] = include_bytes!("static/SourceSerifPro-Bold.ttf.woff");
89
90     /// The file `SourceSerifPro-It.ttf.woff`, the Italic variant of the Source Serif Pro font.
91     pub static ITALIC: &'static [u8] = include_bytes!("static/SourceSerifPro-It.ttf.woff");
92
93     /// The file `SourceSerifPro-LICENSE.txt`, the license text for the Source Serif Pro font.
94     pub static LICENSE: &'static [u8] = include_bytes!("static/SourceSerifPro-LICENSE.md");
95 }
96
97 /// Files related to the Source Code Pro font.
98 pub mod source_code_pro {
99     /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
100     pub static REGULAR: &'static [u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
101
102     /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
103     /// font.
104     pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
105
106     /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
107     pub static ITALIC: &'static [u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
108
109     /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
110     pub static LICENSE: &'static [u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
111 }
112
113 /// Files related to the sidebar in rustdoc sources.
114 pub mod sidebar {
115     /// File script to handle sidebar.
116     pub static SOURCE_SCRIPT: &'static str = include_str!("static/source-script.js");
117 }