| Age | Commit message (Collapse) | Author | Lines |
|
Clean up JS files code a bit
I mostly moved values closer to where they are used to make the code reading easier.
r? ```@notriddle```
|
|
|
|
Co-Authored-By: GuillaumeGomez <guillaume1.gomez@gmail.com>
|
|
Fixes a bug seen at https://docs.rs/gl_constants/0.1.1/gl_constants/index.html
|
|
An attempt to reduce the perf regression in
https://github.com/rust-lang/rust/pull/108052#issuecomment-1430631861
|
|
Discussed in
https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515
This commit also changes the tooltips on rustdoc intra-doc links
targeting methods.
|
|
rustdoc: simplify DOM for `.item-table`
This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
|
|
|
|
|
|
they do not add any `Link` events
|
|
|
|
Related to #96399
|
|
in metadata
|
|
|
|
use chars instead of strings where applicable
|
|
|
|
rustdoc: Use more let chain
Got the idea after yesterday's review.
r? `@notriddle`
|
|
|
|
Remove some superfluous type parameters from layout.rs.
Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
|
|
r=GuillaumeGomez
rustdoc: add more tooltips to intra-doc links
This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it.
See also https://github.com/rust-lang/rust/pull/39697
Partially solves https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 (though the Internals thread asks for color-coding, while this PR adds a tooltip instead, it's accomplishing the same thing).
Before:
<img width="950" alt="image" src="https://user-images.githubusercontent.com/1593513/218653059-911cea01-7231-438a-ad98-be98ab73783f.png">
After:
<img width="432" alt="image" src="https://user-images.githubusercontent.com/1593513/218653201-34ca3aa7-18f1-4cb1-be68-a1411bbe797e.png">
|
|
This commit makes intra-doc link tooltips consistent with generated
links in function signatures and item tables, with the format
`itemtype foo::bar::baz`. This way, you can tell if a link points at
a trait or a type (for example) by mousing over it.
See also fce944d4e79b3a87ddf511206724edf33acfd704
|
|
$ wc -c search-index.old.js search-index.new.js
3940530 search-index.old.js
3843222 search-index.new.js
((3940530-3843222)/3940530)*100 = 2.47%
$ wc -c search-index.old.js.gz search-index.new.js.gz
380251 search-index.old.js.gz
379434 search-index.new.js.gz
((380251-379434)/380251)*100 = 0.214%
|
|
r=GuillaumeGomez
rustdoc: merge doctest tooltip with notable traits tooltip
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000
<details><summary>a user report where the tooltip arrow overlaps the text</summary>

</details>
Fixes #91100
Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing>
Screenshot:

|
|
r=GuillaumeGomez
rustdoc: use tighter line height in h1 and h2
This keeps the line height for body text the same, as required by WCAG, but for headers, it makes sense to have wrapped lines be a bit tighter packed.
## Before

## After

|
|
notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez
rustdoc: account for intra-doc links in `<meta name="description">`
Similar to #86451, but for the SEO descriptions instead of the search descriptions.
|
|
Improve JS function itemTypeFromName code a bit
Very small code improvement replacing a `for` loop with `findIndex` method.
r? ````@notriddle````
|
|
|
|
|
|
|
|
r=camelid
rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`
|
|
r=GuillaumeGomez
rustdoc: clean up `write!` calls with less stuttering
|
|
Resolve documentation links in rustc and store the results in metadata
This PR implements MCP https://github.com/rust-lang/compiler-team/issues/584.
Doc links are now resolved in rustc and stored into metadata, so rustdoc simply retrieves them through a query (local or extern),
Code that is no longer used is removed, and some code that no longer needs to be public is privatized.
The removed code includes resolver cloning, so this PR fixes https://github.com/rust-lang/rust/issues/83761.
|
|
r=GuillaumeGomez
rustdoc: remove inconsistently-present sidebar tooltips
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
|
|
|
|
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584
It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
|
|
rustdoc: remove unused fn parameter `tab`
|
|
|
|
rustdoc: use the same URL escape rules for fragments as for examples
Carries over improvements from #107284
|
|
|
|
[svgo]: https://github.com/svg/svgo
$ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
2972 src/librustdoc/html/static/images/wheel.svg
3764 wheel-old.svg
100*((2972-3764)/3764) = -21.04%
|
|
rustdoc: use a newline instead of `<br>` to format code headers
Since these elements now use `white-space: pre-wrap` since #107615, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
|
|
This switches from using `<div>` to the more semantic `<ul>`, and
using class names that rhyme with the classes the search results
table uses.
|
|
Since these elements now use `white-space: pre-wrap` since
784665d4ce59c5239791f1f96fa2137e47ca1817, it's fine to use newlines
for formatting, which is smaller and a bit less complicated.
|
|
rustdoc: do not include empty default-settings tag in HTML
|
|
r=notriddle
Turn MarkdownWithToc into a struct with named fields
Extracted the commit from https://github.com/rust-lang/rust/pull/107640.
r? `@notriddle`
|
|
|
|
rustdoc: combine duplicate rules in ayu CSS
|
|
r=GuillaumeGomez
rustdoc: compute maximum Levenshtein distance based on the query
Preview: https://notriddle.com/notriddle-rustdoc-demos/search-lev-distance-2023/std/index.html?search=regex
The heuristic is pretty close to the name resolver, maxLevDistance = `Math.floor(queryLen / 3)`.
Fixes #103357
Fixes #82131
Similar to https://github.com/rust-lang/rust/pull/103710, but following the suggestion in https://github.com/rust-lang/rust/pull/103710#issuecomment-1296360267 to use `floor` instead of `ceil`, and unblocked now that https://github.com/rust-lang/rust/pull/105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.
|
|
rustdoc: fix item-spacer
rustdoc: use proper comment style
rustdoc: change formatting where clauses for traits
rustdoc: remove semicolon from provided methods
update provided methods formatting
|
|
|