about summary refs log tree commit diff
path: root/src/librustdoc/html/templates/print_item.html
AgeCommit message (Collapse)AuthorLines
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-2/+2
2025-01-25Remove extra whitespace from rustdoc breadcrumbs for copypastingKornel-2/+2
2024-10-23rustdoc: adjust spacing and typography in headerMichael Howell-1/+1
2024-09-27Remove unneeded jinja comments in templatesGuillaume Gomez-1/+1
2024-09-23Tweak breadcrumbs listMichael Howell-4/+7
2024-09-10rustdoc: make the header show all three buttonsMichael Howell-4/+9
This tweaks it to use less space for the breadcrumbs.
2024-09-10rustdoc: redesign toolbar and disclosure widgetsMichael Howell-7/+6
This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. Additionally, the Help button is only shown on SERPs, not all the time. This is done for two major reasons: * Most of what's in there is search-related. The things that aren't are keyboard commands, and the search box tells you about that anyway. Pressing <kbd>?</kbd> will temporarily show the button and its popover. * I'm trading it off by showing the help button, even on mobile. It's useful since you can use the search engine suggestions there. * The three buttons were causing line wrapping on too many desktop layouts.
2024-04-09rustdoc: load icons from css instead of inlineMichael Howell-3/+1
This cuts the HTML overhead for a page by about 1KiB, significantly reducing the overall size of the docs bundle.
2023-07-14rustdoc: use `src` consistently over `source` in codeMichael Howell-1/+1
The CSS uses an inconsistent mix of both. This commit switches it to always use `src`.
2023-06-21Fix union fields displayGuillaume Gomez-2/+2
2023-03-06Remove unneeded minus sign in jinja tagsGuillaume Gomez-26/+26
2023-01-27rustdoc: remove inline javascript from copy-path buttonMichael Howell-1/+1
2023-01-13rustdoc: remove unnecessary DOM class `h1.fqn`Michael Howell-1/+1
It's misleading. The main heading sometimes isn't an fully qualified name at all. It's also redundant. It's always a child of `div.main-heading`, so just use that.
2022-11-05Rollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomezMatthias Krüger-1/+1
rustdoc: add hash to filename of toolchain files All static files used by rustdoc are now stored in static.files/ and their filenames include a hash of their contents. Their filenames 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. This has a useful side effect: once toolchain files aren't affected by resource suffix, it will become possible for docs.rs to include crate version in the resource suffix. That should fix a caching issue with `/latest/` URLs: https://github.com/rust-lang/docs.rs/issues/1593. My goal is that it should be safe to serve all rustdoc JS, CSS, and fonts with infinite caching headers, even when new versions of a crate are uploaded in the same place as old versions. 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. Example listing: ``` $ cd build/x86_64-unknown-linux-gnu/doc/ && find . | egrep 'js$|css$' | egrep -v 'sidebar-items|implementors' | sort ./crates1.65.0.js ./rust.css ./search-index1.65.0.js ./source-files1.65.0.js ./static.files/ayu-2bfd0af01c176fd5.css ./static.files/dark-95d11b5416841799.css ./static.files/light-c83a97e93a11f15a.css ./static.files/main-efc63f77fb116394.js ./static.files/normalize-76eba96aa4d2e634.css ./static.files/noscript-5bf457055038775c.css ./static.files/rustdoc-7a422337900fa894.css ./static.files/scrape-examples-3dd10048bcead3a4.js ./static.files/search-47f3c289722672cf.js ./static.files/settings-17b08337296ac774.js ./static.files/settings-3f95eacb845293c0.css ./static.files/source-script-215e9db86679192e.js ./static.files/storage-26d846fcae82ff09.js ``` Fixes #98413
2022-10-29rustdoc: add hash to filename of toolchain filesJacob Hoffman-Andrews-1/+1
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-10-24rustdoc: clean up `#toggle-all-docs`Michael Howell-3/+3
This change converts the element from an `<a>` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`.
2022-10-05rustdoc: remove unused CSS class `in-band`Michael Howell-13/+11
Since a7c25b29575c17434406b69773f8c2961af343b3 removed `in-band` from code headers, the only remaining uses of the `in-band` class are: https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/write_shared.rs#L520-L521 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/templates/print_item.html#L2-L3 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/context.rs#L637-L638 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L368-L369 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L401-L402 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/static/js/main.js#L525 Since all of these uses are nested below `h1.fqn`, we can get rid of it, and the support code that was used for when `in-band` was part of item rendering.
2022-07-29Remove unwanted extra white space characters from HTMLGuillaume Gomez-2/+2
2022-01-27rustdoc: remove tooltip from source linkMichael Howell-1/+1
This made more sense back when it was abbreviated, but now it seems redundant.
2022-01-21Fix spacing for `·` between stability and sourceJacob Hoffman-Andrews-1/+1
2022-01-19Move back templates into html folderGuillaume Gomez-0/+30
2022-01-10Migrate rustdoc from Tera to AskamaDirkjan Ochtman-28/+0
See #84419.
2022-01-08Make source links look cleanerJacob Hoffman-Andrews-24/+26
Change from syntaxy-looking [src] to the plain word "source".
2021-10-09Remove some stray whitespace.Jacob Hoffman-Andrews-3/+3
2021-10-08Add template for print_itemJacob Hoffman-Andrews-0/+26
Add print_item.html and the code in print_item.rs to use it.