From e5c24ba400b2744455868c2ac4292d8ee3b1b0be Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 7 Jul 2021 14:27:54 +0200 Subject: [PATCH] Clean up rustdoc static files --- src/bootstrap/test.rs | 2 +- .../docker/host-x86_64/mingw-check/Dockerfile | 4 +- src/librustdoc/config.rs | 2 +- .../html/static/{ => css}/normalize.css | 0 .../html/static/{ => css}/noscript.css | 0 .../html/static/{ => css}/rustdoc.css | 0 .../html/static/{ => css}/settings.css | 0 .../html/static/{ => css}/themes/ayu.css | 0 .../html/static/{ => css}/themes/dark.css | 0 .../html/static/{ => css}/themes/light.css | 0 .../static/{ => fonts}/FiraSans-LICENSE.txt | 0 .../static/{ => fonts}/FiraSans-Medium.woff | Bin .../static/{ => fonts}/FiraSans-Medium.woff2 | Bin .../static/{ => fonts}/FiraSans-Regular.woff | Bin .../static/{ => fonts}/FiraSans-Regular.woff2 | Bin .../{ => fonts}/SourceCodePro-It.ttf.woff | Bin .../{ => fonts}/SourceCodePro-It.ttf.woff2 | Bin .../{ => fonts}/SourceCodePro-LICENSE.txt | 0 .../SourceCodePro-Regular.ttf.woff | Bin .../SourceCodePro-Regular.ttf.woff2 | Bin .../SourceCodePro-Semibold.ttf.woff | Bin .../SourceCodePro-Semibold.ttf.woff2 | Bin .../{ => fonts}/SourceSerif4-Bold.ttf.woff | Bin .../{ => fonts}/SourceSerif4-Bold.ttf.woff2 | Bin .../{ => fonts}/SourceSerif4-It.ttf.woff | Bin .../{ => fonts}/SourceSerif4-It.ttf.woff2 | Bin .../{ => fonts}/SourceSerif4-LICENSE.md | 0 .../{ => fonts}/SourceSerif4-Regular.ttf.woff | Bin .../SourceSerif4-Regular.ttf.woff2 | Bin ...oto-sans-kr-v13-korean-regular-LICENSE.txt | 0 .../noto-sans-kr-v13-korean-regular.woff | Bin .../html/static/{ => images}/brush.svg | 0 .../html/static/{ => images}/clipboard.svg | 0 .../html/static/{ => images}/down-arrow.svg | 0 .../static/{ => images}/favicon-16x16.png | Bin .../static/{ => images}/favicon-32x32.png | Bin .../html/static/{ => images}/favicon.svg | 0 .../html/static/{ => images}/rust-logo.png | Bin .../html/static/{ => images}/wheel.svg | 0 src/librustdoc/html/static/{ => js}/main.js | 0 src/librustdoc/html/static/{ => js}/search.js | 0 .../html/static/{ => js}/settings.js | 0 .../html/static/{ => js}/source-script.js | 0 .../html/static/{ => js}/storage.js | 0 src/librustdoc/html/static_files.rs | 83 +++++++++--------- src/librustdoc/theme/tests.rs | 2 +- .../run-make-fulldeps/rustdoc-themes/Makefile | 2 +- 47 files changed, 48 insertions(+), 47 deletions(-) rename src/librustdoc/html/static/{ => css}/normalize.css (100%) rename src/librustdoc/html/static/{ => css}/noscript.css (100%) rename src/librustdoc/html/static/{ => css}/rustdoc.css (100%) rename src/librustdoc/html/static/{ => css}/settings.css (100%) rename src/librustdoc/html/static/{ => css}/themes/ayu.css (100%) rename src/librustdoc/html/static/{ => css}/themes/dark.css (100%) rename src/librustdoc/html/static/{ => css}/themes/light.css (100%) rename src/librustdoc/html/static/{ => fonts}/FiraSans-LICENSE.txt (100%) rename src/librustdoc/html/static/{ => fonts}/FiraSans-Medium.woff (100%) rename src/librustdoc/html/static/{ => fonts}/FiraSans-Medium.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/FiraSans-Regular.woff (100%) rename src/librustdoc/html/static/{ => fonts}/FiraSans-Regular.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-It.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-It.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-LICENSE.txt (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-Regular.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-Regular.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-Semibold.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceCodePro-Semibold.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-Bold.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-Bold.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-It.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-It.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-LICENSE.md (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-Regular.ttf.woff (100%) rename src/librustdoc/html/static/{ => fonts}/SourceSerif4-Regular.ttf.woff2 (100%) rename src/librustdoc/html/static/{ => fonts}/noto-sans-kr-v13-korean-regular-LICENSE.txt (100%) rename src/librustdoc/html/static/{ => fonts}/noto-sans-kr-v13-korean-regular.woff (100%) rename src/librustdoc/html/static/{ => images}/brush.svg (100%) rename src/librustdoc/html/static/{ => images}/clipboard.svg (100%) rename src/librustdoc/html/static/{ => images}/down-arrow.svg (100%) rename src/librustdoc/html/static/{ => images}/favicon-16x16.png (100%) rename src/librustdoc/html/static/{ => images}/favicon-32x32.png (100%) rename src/librustdoc/html/static/{ => images}/favicon.svg (100%) rename src/librustdoc/html/static/{ => images}/rust-logo.png (100%) rename src/librustdoc/html/static/{ => images}/wheel.svg (100%) rename src/librustdoc/html/static/{ => js}/main.js (100%) rename src/librustdoc/html/static/{ => js}/search.js (100%) rename src/librustdoc/html/static/{ => js}/settings.js (100%) rename src/librustdoc/html/static/{ => js}/source-script.js (100%) rename src/librustdoc/html/static/{ => js}/storage.js (100%) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 64b3ee7c359e7..e4d6a3f587b05 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -742,7 +742,7 @@ impl Step for RustdocTheme { let rustdoc = builder.out.join("bootstrap/debug/rustdoc"); let mut cmd = builder.tool_cmd(Tool::RustdocTheme); cmd.arg(rustdoc.to_str().unwrap()) - .arg(builder.src.join("src/librustdoc/html/static/themes").to_str().unwrap()) + .arg(builder.src.join("src/librustdoc/html/static/css/themes").to_str().unwrap()) .env("RUSTC_STAGE", self.compiler.stage.to_string()) .env("RUSTC_SYSROOT", builder.sysroot(self.compiler)) .env("RUSTDOC_LIBDIR", builder.sysroot_libdir(self.compiler, self.compiler.host)) diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile index 8066ea3a944b3..c27e42a266220 100644 --- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile @@ -40,5 +40,5 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \ /scripts/validate-toolstate.sh && \ /scripts/validate-error-codes.sh && \ # Runs checks to ensure that there are no ES5 issues in our JS code. - es-check es5 ../src/librustdoc/html/static/*.js && \ - eslint ../src/librustdoc/html/static/*.js + es-check es5 ../src/librustdoc/html/static/js/*.js && \ + eslint ../src/librustdoc/html/static/js/*.js diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 1b5a00dde59bc..4cf647a81ae4b 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -513,7 +513,7 @@ impl Options { )) .warn("the theme may appear incorrect when loaded") .help(&format!( - "to see what rules are missing, call `rustdoc --check-theme \"{}\"`", + "to see what rules are missing, call `rustdoc --check-theme \"{}\"`", theme_s )) .emit(); diff --git a/src/librustdoc/html/static/normalize.css b/src/librustdoc/html/static/css/normalize.css similarity index 100% rename from src/librustdoc/html/static/normalize.css rename to src/librustdoc/html/static/css/normalize.css diff --git a/src/librustdoc/html/static/noscript.css b/src/librustdoc/html/static/css/noscript.css similarity index 100% rename from src/librustdoc/html/static/noscript.css rename to src/librustdoc/html/static/css/noscript.css diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css similarity index 100% rename from src/librustdoc/html/static/rustdoc.css rename to src/librustdoc/html/static/css/rustdoc.css diff --git a/src/librustdoc/html/static/settings.css b/src/librustdoc/html/static/css/settings.css similarity index 100% rename from src/librustdoc/html/static/settings.css rename to src/librustdoc/html/static/css/settings.css diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css similarity index 100% rename from src/librustdoc/html/static/themes/ayu.css rename to src/librustdoc/html/static/css/themes/ayu.css diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css similarity index 100% rename from src/librustdoc/html/static/themes/dark.css rename to src/librustdoc/html/static/css/themes/dark.css diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/css/themes/light.css similarity index 100% rename from src/librustdoc/html/static/themes/light.css rename to src/librustdoc/html/static/css/themes/light.css diff --git a/src/librustdoc/html/static/FiraSans-LICENSE.txt b/src/librustdoc/html/static/fonts/FiraSans-LICENSE.txt similarity index 100% rename from src/librustdoc/html/static/FiraSans-LICENSE.txt rename to src/librustdoc/html/static/fonts/FiraSans-LICENSE.txt diff --git a/src/librustdoc/html/static/FiraSans-Medium.woff b/src/librustdoc/html/static/fonts/FiraSans-Medium.woff similarity index 100% rename from src/librustdoc/html/static/FiraSans-Medium.woff rename to src/librustdoc/html/static/fonts/FiraSans-Medium.woff diff --git a/src/librustdoc/html/static/FiraSans-Medium.woff2 b/src/librustdoc/html/static/fonts/FiraSans-Medium.woff2 similarity index 100% rename from src/librustdoc/html/static/FiraSans-Medium.woff2 rename to src/librustdoc/html/static/fonts/FiraSans-Medium.woff2 diff --git a/src/librustdoc/html/static/FiraSans-Regular.woff b/src/librustdoc/html/static/fonts/FiraSans-Regular.woff similarity index 100% rename from src/librustdoc/html/static/FiraSans-Regular.woff rename to src/librustdoc/html/static/fonts/FiraSans-Regular.woff diff --git a/src/librustdoc/html/static/FiraSans-Regular.woff2 b/src/librustdoc/html/static/fonts/FiraSans-Regular.woff2 similarity index 100% rename from src/librustdoc/html/static/FiraSans-Regular.woff2 rename to src/librustdoc/html/static/fonts/FiraSans-Regular.woff2 diff --git a/src/librustdoc/html/static/SourceCodePro-It.ttf.woff b/src/librustdoc/html/static/fonts/SourceCodePro-It.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-It.ttf.woff rename to src/librustdoc/html/static/fonts/SourceCodePro-It.ttf.woff diff --git a/src/librustdoc/html/static/SourceCodePro-It.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceCodePro-It.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-It.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceCodePro-It.ttf.woff2 diff --git a/src/librustdoc/html/static/SourceCodePro-LICENSE.txt b/src/librustdoc/html/static/fonts/SourceCodePro-LICENSE.txt similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-LICENSE.txt rename to src/librustdoc/html/static/fonts/SourceCodePro-LICENSE.txt diff --git a/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff b/src/librustdoc/html/static/fonts/SourceCodePro-Regular.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff rename to src/librustdoc/html/static/fonts/SourceCodePro-Regular.ttf.woff diff --git a/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceCodePro-Regular.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceCodePro-Regular.ttf.woff2 diff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff b/src/librustdoc/html/static/fonts/SourceCodePro-Semibold.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff rename to src/librustdoc/html/static/fonts/SourceCodePro-Semibold.ttf.woff diff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceCodePro-Semibold.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceCodePro-Semibold.ttf.woff2 diff --git a/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff b/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff rename to src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff diff --git a/src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-Bold.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceSerif4-Bold.ttf.woff2 diff --git a/src/librustdoc/html/static/SourceSerif4-It.ttf.woff b/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-It.ttf.woff rename to src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff diff --git a/src/librustdoc/html/static/SourceSerif4-It.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-It.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceSerif4-It.ttf.woff2 diff --git a/src/librustdoc/html/static/SourceSerif4-LICENSE.md b/src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-LICENSE.md rename to src/librustdoc/html/static/fonts/SourceSerif4-LICENSE.md diff --git a/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff b/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff rename to src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff diff --git a/src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2 b/src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 similarity index 100% rename from src/librustdoc/html/static/SourceSerif4-Regular.ttf.woff2 rename to src/librustdoc/html/static/fonts/SourceSerif4-Regular.ttf.woff2 diff --git a/src/librustdoc/html/static/noto-sans-kr-v13-korean-regular-LICENSE.txt b/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt similarity index 100% rename from src/librustdoc/html/static/noto-sans-kr-v13-korean-regular-LICENSE.txt rename to src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt diff --git a/src/librustdoc/html/static/noto-sans-kr-v13-korean-regular.woff b/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular.woff similarity index 100% rename from src/librustdoc/html/static/noto-sans-kr-v13-korean-regular.woff rename to src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular.woff diff --git a/src/librustdoc/html/static/brush.svg b/src/librustdoc/html/static/images/brush.svg similarity index 100% rename from src/librustdoc/html/static/brush.svg rename to src/librustdoc/html/static/images/brush.svg diff --git a/src/librustdoc/html/static/clipboard.svg b/src/librustdoc/html/static/images/clipboard.svg similarity index 100% rename from src/librustdoc/html/static/clipboard.svg rename to src/librustdoc/html/static/images/clipboard.svg diff --git a/src/librustdoc/html/static/down-arrow.svg b/src/librustdoc/html/static/images/down-arrow.svg similarity index 100% rename from src/librustdoc/html/static/down-arrow.svg rename to src/librustdoc/html/static/images/down-arrow.svg diff --git a/src/librustdoc/html/static/favicon-16x16.png b/src/librustdoc/html/static/images/favicon-16x16.png similarity index 100% rename from src/librustdoc/html/static/favicon-16x16.png rename to src/librustdoc/html/static/images/favicon-16x16.png diff --git a/src/librustdoc/html/static/favicon-32x32.png b/src/librustdoc/html/static/images/favicon-32x32.png similarity index 100% rename from src/librustdoc/html/static/favicon-32x32.png rename to src/librustdoc/html/static/images/favicon-32x32.png diff --git a/src/librustdoc/html/static/favicon.svg b/src/librustdoc/html/static/images/favicon.svg similarity index 100% rename from src/librustdoc/html/static/favicon.svg rename to src/librustdoc/html/static/images/favicon.svg diff --git a/src/librustdoc/html/static/rust-logo.png b/src/librustdoc/html/static/images/rust-logo.png similarity index 100% rename from src/librustdoc/html/static/rust-logo.png rename to src/librustdoc/html/static/images/rust-logo.png diff --git a/src/librustdoc/html/static/wheel.svg b/src/librustdoc/html/static/images/wheel.svg similarity index 100% rename from src/librustdoc/html/static/wheel.svg rename to src/librustdoc/html/static/images/wheel.svg diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/js/main.js similarity index 100% rename from src/librustdoc/html/static/main.js rename to src/librustdoc/html/static/js/main.js diff --git a/src/librustdoc/html/static/search.js b/src/librustdoc/html/static/js/search.js similarity index 100% rename from src/librustdoc/html/static/search.js rename to src/librustdoc/html/static/js/search.js diff --git a/src/librustdoc/html/static/settings.js b/src/librustdoc/html/static/js/settings.js similarity index 100% rename from src/librustdoc/html/static/settings.js rename to src/librustdoc/html/static/js/settings.js diff --git a/src/librustdoc/html/static/source-script.js b/src/librustdoc/html/static/js/source-script.js similarity index 100% rename from src/librustdoc/html/static/source-script.js rename to src/librustdoc/html/static/js/source-script.js diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/js/storage.js similarity index 100% rename from src/librustdoc/html/static/storage.js rename to src/librustdoc/html/static/js/storage.js diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 4443c74834d04..2ec7e66234ddd 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -8,44 +8,44 @@ //! directly written to a `Write` handle. /// The file contents of the main `rustdoc.css` file, responsible for the core layout of the page. -crate static RUSTDOC_CSS: &str = include_str!("static/rustdoc.css"); +crate static RUSTDOC_CSS: &str = include_str!("static/css/rustdoc.css"); /// The file contents of `settings.css`, responsible for the items on the settings page. -crate static SETTINGS_CSS: &str = include_str!("static/settings.css"); +crate static SETTINGS_CSS: &str = include_str!("static/css/settings.css"); /// The file contents of the `noscript.css` file, used in case JS isn't supported or is disabled. -crate static NOSCRIPT_CSS: &str = include_str!("static/noscript.css"); +crate static NOSCRIPT_CSS: &str = include_str!("static/css/noscript.css"); /// The file contents of `normalize.css`, included to even out standard elements between browser /// implementations. -crate static NORMALIZE_CSS: &str = include_str!("static/normalize.css"); +crate static NORMALIZE_CSS: &str = include_str!("static/css/normalize.css"); /// The file contents of `main.js`, which contains the core JavaScript used on documentation pages, /// including search behavior and docblock folding, among others. -crate static MAIN_JS: &str = include_str!("static/main.js"); +crate static MAIN_JS: &str = include_str!("static/js/main.js"); /// The file contents of `search.js`, which contains the search behavior. -crate static SEARCH_JS: &str = include_str!("static/search.js"); +crate static SEARCH_JS: &str = include_str!("static/js/search.js"); /// The file contents of `settings.js`, which contains the JavaScript used to handle the settings /// page. -crate static SETTINGS_JS: &str = include_str!("static/settings.js"); +crate static SETTINGS_JS: &str = include_str!("static/js/settings.js"); /// The file contents of `storage.js`, which contains functionality related to browser Local /// Storage, used to store documentation settings. -crate static STORAGE_JS: &str = include_str!("static/storage.js"); +crate static STORAGE_JS: &str = include_str!("static/js/storage.js"); /// The file contents of `brush.svg`, the icon used for the theme-switch button. -crate static BRUSH_SVG: &[u8] = include_bytes!("static/brush.svg"); +crate static BRUSH_SVG: &[u8] = include_bytes!("static/images/brush.svg"); /// The file contents of `wheel.svg`, the icon used for the settings button. -crate static WHEEL_SVG: &[u8] = include_bytes!("static/wheel.svg"); +crate static WHEEL_SVG: &[u8] = include_bytes!("static/images/wheel.svg"); /// The file contents of `clipboard.svg`, the icon used for the "copy path" button. -crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/clipboard.svg"); +crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/images/clipboard.svg"); /// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox. -crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/down-arrow.svg"); +crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/images/down-arrow.svg"); /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation /// output. @@ -58,11 +58,11 @@ crate static LICENSE_APACHE: &[u8] = include_bytes!("static/LICENSE-APACHE.txt") crate static LICENSE_MIT: &[u8] = include_bytes!("static/LICENSE-MIT.txt"); /// The contents of `rust-logo.png`, the default icon of the documentation. -crate static RUST_LOGO: &[u8] = include_bytes!("static/rust-logo.png"); +crate static RUST_LOGO: &[u8] = include_bytes!("static/images/rust-logo.png"); /// The default documentation favicons (SVG and PNG fallbacks) -crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/favicon.svg"); -crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/favicon-16x16.png"); -crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/favicon-32x32.png"); +crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg"); +crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png"); +crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/images/favicon-32x32.png"); crate static PAGE: &str = include_str!("templates/page.html"); @@ -70,101 +70,102 @@ crate static PAGE: &str = include_str!("templates/page.html"); crate mod themes { /// The "light" theme, selected by default when no setting is available. Used as the basis for /// the `--check-theme` functionality. - crate static LIGHT: &str = include_str!("static/themes/light.css"); + crate static LIGHT: &str = include_str!("static/css/themes/light.css"); /// The "dark" theme. - crate static DARK: &str = include_str!("static/themes/dark.css"); + crate static DARK: &str = include_str!("static/css/themes/dark.css"); /// The "ayu" theme. - crate static AYU: &str = include_str!("static/themes/ayu.css"); + crate static AYU: &str = include_str!("static/css/themes/ayu.css"); } /// Files related to the Fira Sans font. crate mod fira_sans { /// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font. - crate static REGULAR: &[u8] = include_bytes!("static/FiraSans-Regular.woff"); + crate static REGULAR: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff"); /// The file `FiraSans-Regular.woff2`, the Regular variant of the Fira Sans font in woff2. - crate static REGULAR2: &[u8] = include_bytes!("static/FiraSans-Regular.woff2"); + crate static REGULAR2: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff2"); /// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font. - crate static MEDIUM: &[u8] = include_bytes!("static/FiraSans-Medium.woff"); + crate static MEDIUM: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff"); /// The file `FiraSans-Medium.woff2`, the Medium variant of the Fira Sans font in woff2. - crate static MEDIUM2: &[u8] = include_bytes!("static/FiraSans-Medium.woff2"); + crate static MEDIUM2: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff2"); /// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font. - crate static LICENSE: &[u8] = include_bytes!("static/FiraSans-LICENSE.txt"); + crate static LICENSE: &[u8] = include_bytes!("static/fonts/FiraSans-LICENSE.txt"); } /// Files related to the Source Serif 4 font. crate mod source_serif_4 { /// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font. - crate static REGULAR: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff"); + crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff"); /// The file `SourceSerif4-Regular.ttf.woff2`, the Regular variant of the Source Serif 4 font in /// woff2. - crate static REGULAR2: &[u8] = include_bytes!("static/SourceSerif4-Regular.ttf.woff2"); + crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff2"); /// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font. - crate static BOLD: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff"); + crate static BOLD: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff"); /// The file `SourceSerif4-Bold.ttf.woff2`, the Bold variant of the Source Serif 4 font in /// woff2. - crate static BOLD2: &[u8] = include_bytes!("static/SourceSerif4-Bold.ttf.woff2"); + crate static BOLD2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff2"); /// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font. - crate static ITALIC: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff"); + crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff"); /// The file `SourceSerif4-It.ttf.woff2`, the Italic variant of the Source Serif 4 font in /// woff2. - crate static ITALIC2: &[u8] = include_bytes!("static/SourceSerif4-It.ttf.woff2"); + crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff2"); /// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font. - crate static LICENSE: &[u8] = include_bytes!("static/SourceSerif4-LICENSE.md"); + crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceSerif4-LICENSE.md"); } /// Files related to the Source Code Pro font. crate mod source_code_pro { /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font. - crate static REGULAR: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff"); + crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff"); /// The file `SourceCodePro-Regular.ttf.woff2`, the Regular variant of the Source Code Pro font /// in woff2. - crate static REGULAR2: &[u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff2"); + crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff2"); /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro /// font. - crate static SEMIBOLD: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff"); + crate static SEMIBOLD: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff"); /// The file `SourceCodePro-Semibold.ttf.woff2`, the Semibold variant of the Source Code Pro /// font in woff2. - crate static SEMIBOLD2: &[u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff2"); + crate static SEMIBOLD2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff2"); /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font. - crate static ITALIC: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff"); + crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff"); /// The file `SourceCodePro-It.ttf.woff2`, the Italic variant of the Source Code Pro font in /// woff2. - crate static ITALIC2: &[u8] = include_bytes!("static/SourceCodePro-It.ttf.woff2"); + crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff2"); /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font. - crate static LICENSE: &[u8] = include_bytes!("static/SourceCodePro-LICENSE.txt"); + crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceCodePro-LICENSE.txt"); } crate mod noto_sans_kr { /// The file `noto-sans-kr-v13-korean-regular.woff`, the Regular variant of the Noto Sans KR /// font. - crate static REGULAR: &[u8] = include_bytes!("static/noto-sans-kr-v13-korean-regular.woff"); + crate static REGULAR: &[u8] = + include_bytes!("static/fonts/noto-sans-kr-v13-korean-regular.woff"); /// The file `noto-sans-kr-v13-korean-regular-LICENSE.txt`, the license text of the Noto Sans KR /// font. crate static LICENSE: &[u8] = - include_bytes!("static/noto-sans-kr-v13-korean-regular-LICENSE.txt"); + include_bytes!("static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt"); } /// Files related to the sidebar in rustdoc sources. crate mod sidebar { /// File script to handle sidebar. - crate static SOURCE_SCRIPT: &str = include_str!("static/source-script.js"); + crate static SOURCE_SCRIPT: &str = include_str!("static/js/source-script.js"); } diff --git a/src/librustdoc/theme/tests.rs b/src/librustdoc/theme/tests.rs index b924215733d55..4968ffd5a27a7 100644 --- a/src/librustdoc/theme/tests.rs +++ b/src/librustdoc/theme/tests.rs @@ -105,7 +105,7 @@ fn check_invalid_css() { #[test] fn test_with_minification() { - let text = include_str!("../html/static/themes/dark.css"); + let text = include_str!("../html/static/css/themes/dark.css"); let minified = minifier::css::minify(&text).expect("CSS minification failed"); let against = load_css_paths(text.as_bytes()); diff --git a/src/test/run-make-fulldeps/rustdoc-themes/Makefile b/src/test/run-make-fulldeps/rustdoc-themes/Makefile index f5a471e66e573..f3d07b25c47f8 100644 --- a/src/test/run-make-fulldeps/rustdoc-themes/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-themes/Makefile @@ -5,6 +5,6 @@ OUTPUT_DIR := "$(TMPDIR)/rustdoc-themes" all: - cp $(S)/src/librustdoc/html/static/themes/light.css $(TMPDIR)/test.css + cp $(S)/src/librustdoc/html/static/css/themes/light.css $(TMPDIR)/test.css $(RUSTDOC) -o $(OUTPUT_DIR) foo.rs --theme $(TMPDIR)/test.css $(HTMLDOCCK) $(OUTPUT_DIR) foo.rs