about summary refs log tree commit diff
path: root/src/librustdoc/html/static_files.rs
AgeCommit message (Collapse)AuthorLines
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-0/+1
2025-02-05Auto merge of #136253 - notriddle:notriddle/aot-minify, r=GuillaumeGomezbors-18/+10
rustdoc: run css and html minifier at build instead of runtime This way, adding a bunch of comments to the JS files won't make rustdoc slower. Meant to address https://github.com/rust-lang/rust/pull/136161#issuecomment-2622069453
2025-01-29rustdoc: run css and html minifier at build instead of runtimeMichael Howell-18/+10
This way, adding a bunch of comments to the JS files won't make rustdoc slower.
2025-01-29Add SemiBold for SourceSerif4Guillaume Gomez-0/+1
2025-01-29Add italic for newly added sans serif fontsGuillaume Gomez-0/+2
2025-01-29Add new setting allowing to switch to sans serif fontsGuillaume Gomez-0/+2
2024-11-28Fix new clippy lintsGuillaume Gomez-1/+1
2024-10-19rustdoc: hash assets at rustdoc build timeMichael Howell-13/+6
Since sha256 is slow enough to show up on small benchmarks, we can save time by embedding the hash in the executable.
2024-10-19rustdoc: Switch from FxHash to sha256 for static file hashing.Alona Enraght-Moony-6/+5
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-04-28Inline `wheel.svg` into CSSGuillaume Gomez-1/+0
2024-04-28Inline `clipboard.svg` into CSSGuillaume Gomez-1/+0
2024-04-09rustdoc: remove unused 16x16 faviconMichael Howell-1/+0
According to <https://caniuse.com/?search=svg%20favicon>, SVG favicons are supported in everything but Safari. When I actually try it in Safari, it's downloading all three favicons, and nothing looks different when I disable the 16x16 one. <https://dev.to/masakudamatsu/favicon-nightmare-how-to-maintain-sanity-3al7>, which is linked from caniuse above, recommends an ico. However, the reason they recommend it is the apps that only support /favicon.ico exactly, and rustdoc can't assume it will be installed to the site root, so it's unfortunately up to the webmaster to make sure it's set up.
2023-09-15rustdoc: merge theme css into rustdoc.cssMichael Howell-3/+0
Based on https://github.com/rust-lang/rust/pull/115812#issuecomment-1717960119 Having them in separate files used to make more sense, before the migration to CSS variables made the theme files as small as they are nowadays. This is already how docs.rs and mdBook do it.
2023-09-13Merge settings.css into rustdoc.cssGuillaume Gomez-1/+0
2023-08-16Improve code readability by moving fmt args directly into the stringGuillaume Gomez-1/+1
2023-07-14rustdoc: use `src` consistently over `source` in JavaScriptMichael Howell-1/+1
Since the directory that contains source files is called `src`, it makes sense to name the scripts that way, too.
2023-02-01Inline CSS background images directly into the CSSGuillaume Gomez-3/+0
2022-11-26Fix UI issues with Rustdoc scrape-examples feature.Will Crichton-1/+1
* Help file was being loaded from the wrong place. * CSS selector in JS has a typo. * Line numbers are overflowing, change to display: grid to fix.
2022-11-18couple of clippy::perf fixesMatthias Krüger-1/+1
2022-11-14Fix missing minification for static filesGuillaume Gomez-2/+6
2022-10-29Generate static file hashes onceJacob Hoffman-Andrews-9/+18
2022-10-29Make --static-root-path point to static.filesJacob Hoffman-Andrews-2/+2
2022-10-29rustdoc: add hash to filename of toolchain filesJacob Hoffman-Andrews-147/+99
All static files used by rustdoc are now stored in static.files/ and include a hash of their contents. They no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL. Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix. The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration.
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-45/+48
2022-05-14Remove theme picker buttonGuillaume Gomez-3/+0
2022-04-21Remove .woff font filesGuillaume Gomez-42/+9
2022-03-27Add scrape examples help pageWill Crichton-0/+2
2022-01-13Use the updated Rust logo and change it's format to SVGLoïc BRANSTETT-2/+3
2021-10-26rustdoc: use ttf based font for cjk glyphsShinwoo Park-9/+29
2021-10-23Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+4
Scrape code examples from examples/ directory for Rustdoc Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123 Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525 Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
2021-10-12rustdoc: update noto sans krShinwoo Park-8/+7
2021-10-08Move template initialization into its own file.Jacob Hoffman-Andrews-3/+0
2021-10-08Add template for print_itemJacob Hoffman-Andrews-0/+1
Add print_item.html and the code in print_item.rs to use it.
2021-10-06Move JS into a standalone fileWill Crichton-0/+4
2021-08-03Simplify usage of CSS background-imageGuillaume Gomez-4/+6
2021-08-03Rustdoc accessibility: use an icon for the [-]/[+] controlsMichael Howell-0/+4
This way, we can show the plus and minus buttons on screens, while voice control will read off actual words "Collapse" and "Expand" instead of reading "open brace minus close brace" and "open brace plus close brace". Part of #87059
2021-07-07Clean up rustdoc static filesGuillaume Gomez-41/+42
2021-06-22Rollup merge of #86402 - tspiteri:source-woff2, r=jshaYuki Okushi-0/+24
rustdoc: add optional woff2 versions of Source Serif and Source Code This provides woff2 versions of Source Serif and Source Code similar to how #82545 provides woff2 versions of Fira Sans. The total byte count for the six files (three for each font family) is reduced by 25% from 476 KiB to 358 KiB.
2021-06-20Use Tera templates for rustdoc.Jacob Hoffman-Andrews-0/+2
Replaces a format!() call in layout::render with a template expansion. Introduces a `templates` field in SharedContext so parts of rustdoc can share pre-rendered templates. This currently builds in a copy of the single template available, like with static files. However, future work can make this live-loadable with a perma-unstable flag, to make rustdoc developers' work easier.
2021-06-17rustdoc: add optional woff2 versions of Source Serif and Source CodeTrevor Spiteri-0/+24
2021-05-31Remove unneeded file to load sidebar items at crate levelGuillaume Gomez-3/+0
2021-05-26Rollup merge of #84048 - konan8205:master, r=jshaYuki Okushi-0/+11
Avoid CJK legacy fonts in Windows As metioned in #84035, the default serif CJK font in Windows is meh-looking. To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
2021-05-15Call `initSidebarItems` in root module of crateJustus K-0/+3
2021-05-15chore: format codeShinwoo Park-3/+6
2021-05-15rustdoc: update static filesShinwoo Park-0/+8
2021-05-10Use an SVG image for clipboard instead of unicode characterGuillaume Gomez-0/+3
2021-04-14Update comment on search.js static file.Jacob Hoffman-Andrews-2/+1
2021-04-12Move search JS into search-index.jsJacob Hoffman-Andrews-0/+4
Export a few variables and functions into the global scope because they are needed both by main.js and search-index.js.
2021-04-05Update Source Serif to release 4.004Trevor Spiteri-11/+10
Now the family name is Source Serif 4 (upstream issue 77) instead of Source Serif Pro.