]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/html/static_files.rs
Auto merge of #85154 - cjgillot:lessfn, r=bjorn3
[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 crate static RUSTDOC_CSS: &str = include_str!("static/rustdoc.css");
12
13 /// The file contents of `settings.css`, responsible for the items on the settings page.
14 crate static SETTINGS_CSS: &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 crate static NOSCRIPT_CSS: &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 crate static NORMALIZE_CSS: &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 crate static MAIN_JS: &str = include_str!("static/main.js");
26
27 /// The file contents of `search.js`, which contains the search behavior.
28 crate static SEARCH_JS: &str = include_str!("static/search.js");
29
30 /// The file contents of `settings.js`, which contains the JavaScript used to handle the settings
31 /// page.
32 crate static SETTINGS_JS: &str = include_str!("static/settings.js");
33
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/storage.js");
37
38 /// The file contents of `brush.svg`, the icon used for the theme-switch button.
39 crate static BRUSH_SVG: &[u8] = include_bytes!("static/brush.svg");
40
41 /// The file contents of `wheel.svg`, the icon used for the settings button.
42 crate static WHEEL_SVG: &[u8] = include_bytes!("static/wheel.svg");
43
44 /// The file contents of `clipboard.svg`, the icon used for the "copy path" button.
45 crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/clipboard.svg");
46
47 /// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox.
48 crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/down-arrow.svg");
49
50 /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation
51 /// output.
52 crate static COPYRIGHT: &[u8] = include_bytes!("static/COPYRIGHT.txt");
53
54 /// The contents of `LICENSE-APACHE.txt`, the text of the Apache License, version 2.0.
55 crate static LICENSE_APACHE: &[u8] = include_bytes!("static/LICENSE-APACHE.txt");
56
57 /// The contents of `LICENSE-MIT.txt`, the text of the MIT License.
58 crate static LICENSE_MIT: &[u8] = include_bytes!("static/LICENSE-MIT.txt");
59
60 /// The contents of `rust-logo.png`, the default icon of the documentation.
61 crate static RUST_LOGO: &[u8] = include_bytes!("static/rust-logo.png");
62 /// The default documentation favicons (SVG and PNG fallbacks)
63 crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/favicon.svg");
64 crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/favicon-16x16.png");
65 crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/favicon-32x32.png");
66
67 /// The built-in themes given to every documentation site.
68 crate mod themes {
69     /// The "light" theme, selected by default when no setting is available. Used as the basis for
70     /// the `--check-theme` functionality.
71     crate static LIGHT: &str = include_str!("static/themes/light.css");
72
73     /// The "dark" theme.
74     crate static DARK: &str = include_str!("static/themes/dark.css");
75
76     /// The "ayu" theme.
77     crate static AYU: &str = include_str!("static/themes/ayu.css");
78 }
79
80 /// Files related to the Fira Sans font.
81 crate mod fira_sans {
82     /// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font.
83     crate static REGULAR: &[u8] = include_bytes!("static/FiraSans-Regular.woff");
84
85     /// The file `FiraSans-Regular.woff2`, the Regular variant of the Fira Sans font in woff2.
86     crate static REGULAR2: &[u8] = include_bytes!("static/FiraSans-Regular.woff2");
87
88     /// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font.
89     crate static MEDIUM: &[u8] = include_bytes!("static/FiraSans-Medium.woff");
90
91     /// The file `FiraSans-Medium.woff2`, the Medium variant of the Fira Sans font in woff2.
92     crate static MEDIUM2: &[u8] = include_bytes!("static/FiraSans-Medium.woff2");
93
94     /// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font.
95     crate static LICENSE: &[u8] = include_bytes!("static/FiraSans-LICENSE.txt");
96 }
97
98 /// Files related to the Source Serif 4 font.
99 crate mod source_serif_4 {
100     /// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
101     crate static REGULAR: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff");
102
103     /// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
104     crate static BOLD: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff");
105
106     /// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
107     crate static ITALIC: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff");
108
109     /// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
110     crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md");
111 }
112
113 /// Files related to the Source Code Pro font.
114 crate mod source_code_pro {
115     /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
116     crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
117
118     /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
119     /// font.
120     crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
121
122     /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
123     crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
124
125     /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
126     crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");
127 }
128
129 crate mod noto_sans_kr {
130     /// The file `noto-sans-kr-v13-korean-regular.woff`, the Regular variant of the Noto Sans KR
131     /// font.
132     crate static REGULAR: &[u8] = include_bytes!("static/noto-sans-kr-v13-korean-regular.woff");
133
134     /// The file `noto-sans-kr-v13-korean-regular-LICENSE.txt`, the license text of the Noto Sans KR
135     /// font.
136     crate static LICENSE: &[u8] =
137         include_bytes!("static/noto-sans-kr-v13-korean-regular-LICENSE.txt");
138 }
139
140 /// Files related to the sidebar in rustdoc sources.
141 crate mod sidebar {
142     /// File script to handle sidebar.
143     crate static SOURCE_SCRIPT: &str = include_str!("static/source-script.js");
144 }