about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2023-02-27Rollup merge of #108494 - GuillaumeGomez:cleanup-js, r=notriddleMatthias Krüger-13/+7
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```
2023-02-26Clean up JS files code a bitGuillaume Gomez-13/+7
2023-02-25Update search eBNF with `!` movedMichael Howell-2/+2
Co-Authored-By: GuillaumeGomez <guillaume1.gomez@gmail.com>
2023-02-23rustdoc: avoid including `<li>` tags in item table short descMichael Howell-4/+1
Fixes a bug seen at https://docs.rs/gl_constants/0.1.1/gl_constants/index.html
2023-02-22rustdoc: reduce allocations when generating tooltipsMichael Howell-10/+17
An attempt to reduce the perf regression in https://github.com/rust-lang/rust/pull/108052#issuecomment-1430631861
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-1/+1
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.
2023-02-19Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomezDylan DPC-17/+19
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.
2023-02-18doc links: Filter away autolinks in both rustc and rustdocVadim Petrochenkov-16/+8
2023-02-18rustdoc: Cleanup broken link callbacksVadim Petrochenkov-29/+17
2023-02-18rustdoc: Do not use Footnotes and HeadingLinks when extracting doc linksVadim Petrochenkov-8/+3
they do not add any `Link` events
2023-02-16Correct eslint warningMichael Howell-1/+1
2023-02-16rustdoc: search by macro when query ends with `!`Michael Howell-4/+24
Related to #96399
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-1/+1
2023-02-16Rollup merge of #108099 - matthiaskrgr:str_to_char, r=GuillaumeGomezMatthias Krüger-3/+3
use chars instead of strings where applicable
2023-02-15use chars instead of strings where applicableMatthias Krüger-3/+3
2023-02-15Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddleMatthias Krüger-44/+36
rustdoc: Use more let chain Got the idea after yesterday's review. r? `@notriddle`
2023-02-15Use more let chainGuillaume Gomez-44/+36
2023-02-15Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8KiDylan DPC-2/+2
Remove some superfluous type parameters from layout.rs. Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-02-14Rollup merge of #108025 - notriddle:notriddle/intra-doc-link-tooltips, ↵Matthias Krüger-5/+27
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">
2023-02-13rustdoc: add more tooltips to intra-doc linksMichael Howell-5/+27
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
2023-02-13rustdoc: use a string with one-character codes for search index typesMichael Howell-5/+15
$ 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%
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-109/+81
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> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-12Rollup merge of #107964 - notriddle:notriddle/title-line-height, ↵Matthias Krüger-0/+8
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 ![image](https://user-images.githubusercontent.com/1593513/218332683-88a02467-7811-4e6b-81f8-67dded691465.png) ## After ![image](https://user-images.githubusercontent.com/1593513/218332698-a1b2a265-0658-4306-8473-b835f663172d.png)
2023-02-12Rollup merge of #107934 - ↵Matthias Krüger-4/+16
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.
2023-02-12Rollup merge of #107930 - GuillaumeGomez:js-func-improvement, r=notriddleMatthias Krüger-6/+4
Improve JS function itemTypeFromName code a bit Very small code improvement replacing a `for` loop with `findIndex` method. r? ````@notriddle````
2023-02-12rustdoc: use tighter line height in h1 and h2Michael Howell-0/+8
2023-02-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-4/+16
2023-02-11Improve JS function itemTypeFromName code a bitGuillaume Gomez-6/+4
2023-02-11Rollup merge of #107909 - notriddle:notriddle/register-header-empty-cond, ↵Matthias Krüger-5/+1
r=camelid rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`
2023-02-11Rollup merge of #107864 - notriddle:notriddle/rustdoc-write-stutter, ↵Matthias Krüger-15/+12
r=GuillaumeGomez rustdoc: clean up `write!` calls with less stuttering
2023-02-11Auto merge of #94857 - petrochenkov:doclink2, r=oli-obkbors-9/+1
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.
2023-02-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-14/+4
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
2023-02-10rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`Michael Howell-5/+1
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-9/+1
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.
2023-02-10Rollup merge of #107852 - notriddle:notriddle/rm-tab, r=GuillaumeGomezMatthias Krüger-7/+5
rustdoc: remove unused fn parameter `tab`
2023-02-09rustdoc: clean up `write!` calls with less stutteringMichael Howell-15/+12
2023-02-09Rollup merge of #107655 - notriddle:notriddle/small-url-encode, r=GuillaumeGomezDylan DPC-64/+54
rustdoc: use the same URL escape rules for fragments as for examples Carries over improvements from #107284
2023-02-09rustdoc: remove unused fn parameter `tab`Michael Howell-7/+5
2023-02-08rustdoc: use [svgo] to shrink `wheel.svg`Michael Howell-1/+1
[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%
2023-02-08Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomezMatthias Krüger-17/+14
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.
2023-02-07rustdoc: simplify DOM for `.item-table`Michael Howell-17/+19
This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-07rustdoc: use a newline instead of `<br>` to format code headersMichael Howell-17/+14
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.
2023-02-07Rollup merge of #107471 - notriddle:notriddle/default-settings, r=GuillaumeGomezMatthias Krüger-0/+2
rustdoc: do not include empty default-settings tag in HTML
2023-02-06Rollup merge of #107725 - GuillaumeGomez:turn-markdownwithtoc-into-struct, ↵Matthias Krüger-9/+9
r=notriddle Turn MarkdownWithToc into a struct with named fields Extracted the commit from https://github.com/rust-lang/rust/pull/107640. r? `@notriddle`
2023-02-06Turn MarkdownWithToc into a struct with named fieldsGuillaume Gomez-9/+9
2023-02-06Rollup merge of #107669 - notriddle:notriddle/ayu-smaller, r=GuillaumeGomezDylan DPC-34/+14
rustdoc: combine duplicate rules in ayu CSS
2023-02-06Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, ↵bors-65/+84
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.
2023-02-04rustdoc: trait bound formattingRoland Strasser-12/+21
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
2023-02-04rustdoc: combine duplicate rules in ayu CSSMichael Howell-34/+14