1 //! Static files bundled with documentation output.
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.
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.
10 /// The file contents of the main `rustdoc.css` file, responsible for the core layout of the page.
11 crate static RUSTDOC_CSS: &str = include_str!("static/css/rustdoc.css");
13 /// The file contents of `settings.css`, responsible for the items on the settings page.
14 crate static SETTINGS_CSS: &str = include_str!("static/css/settings.css");
16 /// The file contents of the `noscript.css` file, used in case JS isn't supported or is disabled.
17 crate static NOSCRIPT_CSS: &str = include_str!("static/css/noscript.css");
19 /// The file contents of `normalize.css`, included to even out standard elements between browser
21 crate static NORMALIZE_CSS: &str = include_str!("static/css/normalize.css");
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 crate static MAIN_JS: &str = include_str!("static/js/main.js");
27 /// The file contents of `search.js`, which contains the search behavior.
28 crate static SEARCH_JS: &str = include_str!("static/js/search.js");
30 /// The file contents of `settings.js`, which contains the JavaScript used to handle the settings
32 crate static SETTINGS_JS: &str = include_str!("static/js/settings.js");
34 /// The file contents of `storage.js`, which contains functionality related to browser Local
35 /// Storage, used to store documentation settings.
36 crate static STORAGE_JS: &str = include_str!("static/js/storage.js");
38 /// The file contents of `scraped-examples.js`, which contains functionality related to the
39 /// --scrape-examples flag that inserts automatically-found examples of usages of items.
40 crate static SCRAPE_EXAMPLES_JS: &str = include_str!("static/js/scrape-examples.js");
42 /// The file contents of `brush.svg`, the icon used for the theme-switch button.
43 crate static BRUSH_SVG: &[u8] = include_bytes!("static/images/brush.svg");
45 /// The file contents of `wheel.svg`, the icon used for the settings button.
46 crate static WHEEL_SVG: &[u8] = include_bytes!("static/images/wheel.svg");
48 /// The file contents of `clipboard.svg`, the icon used for the "copy path" button.
49 crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/images/clipboard.svg");
51 /// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox.
52 crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/images/down-arrow.svg");
54 /// The file contents of `toggle-minus.svg`, the icon used for opened toggles.
55 crate static TOGGLE_MINUS_PNG: &[u8] = include_bytes!("static/images/toggle-minus.svg");
57 /// The file contents of `toggle-plus.svg`, the icon used for closed toggles.
58 crate static TOGGLE_PLUS_PNG: &[u8] = include_bytes!("static/images/toggle-plus.svg");
60 /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation
62 crate static COPYRIGHT: &[u8] = include_bytes!("static/COPYRIGHT.txt");
64 /// The contents of `LICENSE-APACHE.txt`, the text of the Apache License, version 2.0.
65 crate static LICENSE_APACHE: &[u8] = include_bytes!("static/LICENSE-APACHE.txt");
67 /// The contents of `LICENSE-MIT.txt`, the text of the MIT License.
68 crate static LICENSE_MIT: &[u8] = include_bytes!("static/LICENSE-MIT.txt");
70 /// The contents of `rust-logo.png`, the default icon of the documentation.
71 crate static RUST_LOGO: &[u8] = include_bytes!("static/images/rust-logo.png");
72 /// The default documentation favicons (SVG and PNG fallbacks)
73 crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg");
74 crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png");
75 crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/images/favicon-32x32.png");
77 /// The built-in themes given to every documentation site.
79 /// The "light" theme, selected by default when no setting is available. Used as the basis for
80 /// the `--check-theme` functionality.
81 crate static LIGHT: &str = include_str!("static/css/themes/light.css");
84 crate static DARK: &str = include_str!("static/css/themes/dark.css");
87 crate static AYU: &str = include_str!("static/css/themes/ayu.css");
90 /// Files related to the Fira Sans font.
92 /// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font.
93 crate static REGULAR: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff");
95 /// The file `FiraSans-Regular.woff2`, the Regular variant of the Fira Sans font in woff2.
96 crate static REGULAR2: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff2");
98 /// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font.
99 crate static MEDIUM: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff");
101 /// The file `FiraSans-Medium.woff2`, the Medium variant of the Fira Sans font in woff2.
102 crate static MEDIUM2: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff2");
104 /// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font.
105 crate static LICENSE: &[u8] = include_bytes!("static/fonts/FiraSans-LICENSE.txt");
108 /// Files related to the Source Serif 4 font.
109 crate mod source_serif_4 {
110 /// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
111 crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff");
113 /// The file `SourceSerif4-Regular.ttf.woff2`, the Regular variant of the Source Serif 4 font in
115 crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff2");
117 /// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
118 crate static BOLD: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff");
120 /// The file `SourceSerif4-Bold.ttf.woff2`, the Bold variant of the Source Serif 4 font in
122 crate static BOLD2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff2");
124 /// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
125 crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff");
127 /// The file `SourceSerif4-It.ttf.woff2`, the Italic variant of the Source Serif 4 font in
129 crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff2");
131 /// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
132 crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceSerif4-LICENSE.md");
135 /// Files related to the Source Code Pro font.
136 crate mod source_code_pro {
137 /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
138 crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff");
140 /// The file `SourceCodePro-Regular.ttf.woff2`, the Regular variant of the Source Code Pro font
142 crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff2");
144 /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
146 crate static SEMIBOLD: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff");
148 /// The file `SourceCodePro-Semibold.ttf.woff2`, the Semibold variant of the Source Code Pro
150 crate static SEMIBOLD2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff2");
152 /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
153 crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff");
155 /// The file `SourceCodePro-It.ttf.woff2`, the Italic variant of the Source Code Pro font in
157 crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff2");
159 /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
160 crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceCodePro-LICENSE.txt");
163 /// Files related to the Nanum Barun Gothic font.
165 /// These files are used to avoid some legacy CJK serif fonts in Windows.
167 /// Note that the Noto Sans KR font, which was used previously but was not very readable on Windows,
168 /// has been replaced by the Nanum Barun Gothic font. This is due to Windows' implementation of font
169 /// rendering that distorts OpenType fonts too much.
171 /// The font files were generated with these commands:
174 /// pyftsubset NanumBarunGothic.ttf \
175 /// --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
176 /// --output-file=NanumBarunGothic.ttf.woff --flavor=woff
179 /// pyftsubset NanumBarunGothic.ttf \
180 /// --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
181 /// --output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
183 crate mod nanum_barun_gothic {
184 /// The file `NanumBarunGothic.ttf.woff`, the Regular variant of the Nanum Barun Gothic font.
185 crate static REGULAR: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff");
187 /// The file `NanumBarunGothic.ttf.woff2`, the Regular variant of the Nanum Barun Gothic font.
188 crate static REGULAR2: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff2");
190 /// The file `NanumBarunGothic-LICENSE.txt`, the license text of the Nanum Barun Gothic font.
191 crate static LICENSE: &[u8] = include_bytes!("static/fonts/NanumBarunGothic-LICENSE.txt");
194 /// Files related to the sidebar in rustdoc sources.
196 /// File script to handle sidebar.
197 crate static SOURCE_SCRIPT: &str = include_str!("static/js/source-script.js");