about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2024-07-25rustdoc: change title of search resultsbinarycat-1/+1
the current title is too similar to that of the page for std::result::Result, which is a problem both for navigating to the Result docs via browser autocomplete, and for being able to tell which tab is which when the width of tabs is small.
2024-07-21rustdoc: revert spacing change in item-tableMichael Howell-1/+0
It really wasn't necessary for the bug fix, and could reasonably be considered a functional regression.
2024-07-21Rollup merge of #128023 - Kijewski:pr-table-width, r=notriddleJubilee-0/+1
rustdoc: short descriptions cause word-breaks in tables The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word. This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive. See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases). [![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2) The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
2024-07-21rustdoc: short descr. cause word-breaks in tablesRené Kijewski-0/+1
The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word. This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive. Signed-off-by: René Kijewski <rene.kijewski@fu-berlin.de>
2024-07-20Fix stab display in doc blocksGuillaume Gomez-0/+4
2024-07-19Auto merge of #127969 - matthiaskrgr:rollup-nhxmwhn, r=matthiaskrgrbors-1/+0
Rollup of 7 pull requests Successful merges: - #112328 (Feat. adding ext that returns change_time) - #126199 (Add `isqrt` to `NonZero<uN>`) - #127856 (interpret: add sanity check in dyn upcast to double-check what codegen does) - #127934 (Improve error when a compiler/library build fails in `checktools.sh`) - #127960 (Cleanup dll/exe filename calculations in `run_make_support`) - #127963 (Fix display of logo "border") - #127967 (Disable run-make/split-debuginfo test for RISC-V 64) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Rollup merge of #127963 - GuillaumeGomez:fix-logo-display, r=notriddleMatthias Krüger-1/+0
Fix display of logo "border" Before: ![Screenshot from 2024-07-19 13-32-17](https://github.com/user-attachments/assets/381bb9c8-0ae0-408b-8476-9785ef1b5fd4) After: ![Screenshot from 2024-07-19 13-37-46](https://github.com/user-attachments/assets/19cdb71f-3912-4fcd-95de-99b9f86a8293) r? `@notriddle`
2024-07-19Fix display of logo "border"Guillaume Gomez-1/+0
2024-07-19Rollup merge of #127932 - notriddle:notriddle/current, r=GuillaumeGomezMatthias Krüger-3/+5
rustdoc: fix `current` class on sidebar modnav | Before | After | | -- | -- | | ![image](https://github.com/user-attachments/assets/35866be8-5a58-41eb-9169-b2bb403fe7cd) | ![image](https://github.com/user-attachments/assets/89b087ea-82bf-49f5-9c87-20162880eb32)
2024-07-18Rearrange sidebar modnav builder to more logical orderMichael Howell-2/+2
2024-07-18rustdoc: fix `current` class on sidebar modnavMichael Howell-3/+5
2024-07-18Wrap too long item name and improve the item list display a bitGuillaume Gomez-0/+8
2024-07-18Unify UI between code block buttons and top buttonsGuillaume Gomez-7/+14
2024-07-18Make "copy code" button the same size as the "copy path" buttonGuillaume Gomez-23/+11
2024-07-18Add copy code buttonGuillaume Gomez-40/+132
2024-07-17Rollup merge of #127229 - notriddle:notriddle/mile-wide-bar, r=GuillaumeGomezMatthias Krüger-4/+51
rustdoc: click target for sidebar items flush left This change adjusts the clickable area of sidebar links to touch the leftmost edge of the canvas, making them [much easier](https://www.nngroup.com/articles/fitts-law/) to click (when the browser window is maximized or tiled left, but those cases are common enough to matter). [Screencast from 2024-07-15 15-31-07.webm](https://github.com/user-attachments/assets/1e952d3a-e9e7-476b-b211-44a17c190b38) <details><summary>old screencast</summary> [Screencast from 2024-07-01 17-23-34.webm](https://github.com/rust-lang/rust/assets/1593513/dc6f9c2e-5904-403d-b353-d233e6e1afbc) </details>
2024-07-15rustdoc: make sidebar highlight cover whole click targetMichael Howell-2/+41
2024-07-15Create new CSS class for "big toggles"Guillaume Gomez-2/+2
2024-07-15Fix styleGuillaume Gomez-0/+5
2024-07-15doc: Fold inline methods from DerefLzu Tao-0/+5
2024-07-05rustdoc-search: stop constructing pointless arrays in decodeMichael Howell-11/+7
I'm not sure why I ever thought that would be okay. This is clearly hot code, and should avoid Array.prototype.map when it's not needed. In any case, it shows up in the profiler. rustdoc-js-profiler: https://notriddle.com/rustdoc-html-demo-11/decode-opt-1/index.html Firefox profiler: [Before](https://share.firefox.dev/3RRH2fR) [After](https://share.firefox.dev/3Wblcq8)
2024-07-01rustdoc: click target for sidebar items flush leftMichael Howell-4/+12
2024-06-09rustdoc-search: use lowercase, non-normalized name for type searchMichael Howell-4/+8
The type name ID map has underscores in its names, so the query element should have them, too.
2024-06-07Update testsSunshine-2/+3
2024-06-07Follow ESLint instructions.Sunshine-4/+7
2024-06-07Other EcmaScript version bumpSunshine-1/+1
2024-06-07Bump the EcmaScript version in the eslint configuration.Sunshine-1/+1
2024-06-07TidyingSunshine-2/+4
2024-06-07Add test for PR #126057Sunshine-1/+2
2024-06-06Make html rendered by rustdoc allow searching non-English identifier / ↵Sunshine-70/+78
alias. Fix alias search result showing `undefined` description.
2024-05-07Rollup merge of #124738 - notriddle:notriddle/search-form-js, r=GuillaumeGomezMatthias Krüger-0/+43
rustdoc: dedup search form HTML This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test. There should be no visible changes. Just use less disk space.
2024-05-06Rollup merge of #124765 - GuillaumeGomez:fix-wrong-cog-colotr, r=notriddleMatthias Krüger-0/+5
[rustdoc] Fix bad color for setting cog in ayu theme Before: ![Screenshot from 2024-05-05 19-29-36](https://github.com/rust-lang/rust/assets/3050060/e1f078e5-7fb3-472d-91e7-b4bde551d411) After: ![image](https://github.com/rust-lang/rust/assets/3050060/0aa115ac-dd69-48e1-b93e-067a39cf25d2) r? ````@notriddle````
2024-05-05Fix bad color for setting cog in ayu themeGuillaume Gomez-0/+5
2024-05-05rustdoc: dedup search form HTMLMichael Howell-0/+43
This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test.
2024-05-05Rollup merge of #124148 - notriddle:notriddle/reference, r=GuillaumeGomezGuillaume Gomez-0/+31
rustdoc-search: search for references This feature extends rustdoc with syntax and search index information for searching borrow references. Part of https://github.com/rust-lang/rust/issues/60485 ## Preview - [`&mut`](https://notriddle.com/rustdoc-html-demo-11/reference/std/index.html?search=%26mut) - [`&Option<T> -> Option<&T>`](https://notriddle.com/rustdoc-html-demo-11/reference/std/index.html?search=%26Option%3CT%3E%20-%3E%20Option%3C%26T%3E) - [`&mut Option<T> -> Option<&mut T>`](https://notriddle.com/rustdoc-html-demo-11/reference/std/index.html?search=%26mut%20Option%3CT%3E%20-%3E%20Option%3C%26mut%20T%3E) Updated chapter of the book: https://notriddle.com/rustdoc-html-demo-11/reference/rustdoc/read-documentation/search.html ## Motivation See https://github.com/rust-lang/rust/pull/119676 ## Guide-level explanation You can't search by lifetimes, but other than that it's the same syntax references normally use. ## Reference-level description <table> <thead> <tr> <th>Shorthand</th> <th>Explicit names</th> </tr> </thead> <tbody> <tr><td colspan="2">Before this PR</td></tr> <tr> <td><code>[]</code></td> <td><code>primitive:slice</code> and/or <code>primitive:array</code></td> </tr> <tr> <td><code>[T]</code></td> <td><code>primitive:slice&lt;T&gt;</code> and/or <code>primitive:array&lt;T&gt;</code></td> </tr> <tr> <td><code>!</code></td> <td><code>primitive:never</code></td> </tr> <tr> <td><code>()</code></td> <td><code>primitive:unit</code> and/or <code>primitive:tuple</code></td> </tr> <tr> <td><code>(T)</code></td> <td><code>T</code></td> </tr> <tr> <td><code>(T,)</code></td> <td><code>primitive:tuple&lt;T&gt;</code></td> </tr> <tr> <td><code>(T, U -> V, W)</code></td> <td><code>fn(T, U) -> (V, W)</code>, Fn, FnMut, and FnOnce</td> </tr> <tr><td colspan="2">New additions with this PR</td></tr> <tr> <td><code>&</code></td> <td><code>primitive:reference</td> </tr> <tr> <td><code>&mut</code></td> <td><code>primitive:reference&lt;keyword:mut&gt;</td> </tr> <tr> <td><code>&T</code></td> <td><code>primitive:reference&lt;T&gt;</td> </tr> <tr> <td><code>&mut T</code></td> <td><code>primitive:reference&lt;keyword:mut, T&gt;</td> </tr> </tbody> </table> ### Search query grammar <code><pre><strong>borrow-ref = AMP *WS [MUT] *WS [arg]</strong> arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like / <strong>borrow-ref</strong>)</pre></code> ``` AMP = "&" MUT = "mut" ``` ## Future direction As described in https://github.com/rust-lang/rust/pull/118194 and https://github.com/rust-lang/rust/pull/119676 * The remaining type expression grammar (this is another step in the type expression grammar: `ReferenceType` is now supported) * Search subtyping and traits
2024-04-28Add some missing comments to describe what the inlined SVG isGuillaume Gomez-0/+4
2024-04-28Inline `wheel.svg` into CSSGuillaume Gomez-2/+14
2024-04-28Inline `clipboard.svg` into CSSGuillaume Gomez-2/+11
2024-04-19rustdoc-search: add parser for `&` syntaxMichael Howell-0/+31
2024-04-18rustdoc-search: fix description on aliases in resultsMichael Howell-10/+11
This needs to start downloading the descriptions after aliases have been added to the result set.
2024-04-18Auto merge of #119912 - notriddle:notriddle/reexport-dedup, r=GuillaumeGomezbors-12/+42
rustdoc-search: single result for items with multiple paths Part of #15723 Preview: https://notriddle.com/rustdoc-html-demo-9/reexport-dup/std/index.html?search=hashmap This change uses the same "exact" paths as trait implementors and type alias inlining to track items with multiple reachable paths. This way, if you search for `vec`, you get only the `std` exports of it, and not the one from `alloc`. It still includes all the items in the search index so that you can search for them by all available paths. For example, try `core::option` and `std::option`, and notice that the results page doesn't show duplicates, but still shows all the items in their respective crates.
2024-04-18Rollup merge of #124041 - GuillaumeGomez:fix-copy-path-button, r=notriddleMatthias Krüger-25/+12
Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in https://github.com/rust-lang/rust/pull/123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? ``@notriddle``
2024-04-17Fix copy-path buttonGuillaume Gomez-25/+12
2024-04-16Rollup merge of #123355 - mu001999:rustdoc/search, r=GuillaumeGomezMatthias Krüger-1/+2
Support type '/' to search Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559
2024-04-09rustdoc: remove unused 16x16 faviconMichael Howell-0/+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.
2024-04-09rustdoc: load icons from css instead of inlineMichael Howell-4/+20
This cuts the HTML overhead for a page by about 1KiB, significantly reducing the overall size of the docs bundle.
2024-04-08rustdoc: add re-export info to RawSearchIndex type defMichael Howell-6/+13
2024-04-08rustdoc-search: single result for items with multiple pathsMichael Howell-6/+29
This change uses the same "exact" paths as trait implementors and type alias inlining to track items with multiple reachable paths. This way, if you search for `vec`, you get only the `std` exports of it, and not the one from `alloc`. It still includes all the items in the search index so that you can search for them by all available paths. For example, try `core::option` and `std::option`, and notice that the results page doesn't show duplicates, but still shows all the items in their respective crates.
2024-04-03Default to light theme is JS is enabled but not workingGuillaume Gomez-3/+9
2024-04-02Support type '/' to searchmu001999-1/+2