about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2023-03-04Rollup merge of #108734 - clubby789:rustdoc-layout-uninhabited, r=GuillaumeGomezMatthias Krüger-0/+6
rustdoc: Note in a type's layout/size if it is uninhabited Closes #87008 ![image](https://user-images.githubusercontent.com/13556931/222900244-8e326d51-8d3b-4700-a935-96830179e2e9.png)
2023-03-04rustdoc: include link on all.html location headerMichael Howell-3/+1
This avoids a subtle layout shift when switching from the crate page to all items.
2023-03-04rustdoc: function signature search with traits in `where` clauseMichael Howell-21/+13
2023-03-04rustdoc: Note in a type's layout/size if it is uninhabitedclubby789-0/+6
2023-02-19Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomezDylan DPC-10/+10
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-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-15Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddleMatthias Krüger-35/+31
rustdoc: Use more let chain Got the idea after yesterday's review. r? `@notriddle`
2023-02-15Use more let chainGuillaume Gomez-35/+31
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-13rustdoc: use a string with one-character codes for search index typesMichael Howell-1/+10
$ 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-1/+1
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 #107934 - ↵Matthias Krüger-1/+4
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-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-1/+4
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-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-9/+3
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-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-23/+52
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-07rustdoc: simplify DOM for `.item-table`Michael Howell-10/+10
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-04rustdoc: trait bound formattingRoland Strasser-10/+10
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-03rustdoc: use the same URL escape rules for fragments as for examplesMichael Howell-23/+52
2023-02-03Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomezMichael Goulet-2/+2
Replace nbsp in all rustdoc code blocks Based on #106125 by `@dtolnay` — this PR fixes the line wrapping bug. Fixes #106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
2023-02-03Replace nbsp in all rustdoc code blocksMichael Howell-2/+2
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
2023-02-02Auto merge of #107000 - GuillaumeGomez:fix-items-in-doc-hidden-block, ↵bors-1/+1
r=notriddle,petrochenkov Fix handling of items inside a `doc(hidden)` block Fixes #106373. cc `@aDotInTheVoid` r? `@notriddle`
2023-01-31rustdoc: stop making unstable items transparentMichael Howell-14/+5
Fixes #93393
2023-01-31rustdoc: remove inconsistently-present sidebar tooltipsMichael Howell-9/+3
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-01-31Rollup merge of #107482 - notriddle:notriddle/keywords, r=jshaYuki Okushi-12/+2
rustdoc: remove meta keywords from HTML Discussed in <https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60.3Cmeta.20name.3D.22keywords.22.3E.60>
2023-01-30rustdoc: remove meta keywords from HTMLMichael Howell-12/+2
Discussed in <https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60.3Cmeta.20name.3D.22keywords.22.3E.60>
2023-01-30rustdoc: remove unnecessary wrapper div.item-decl from HTMLMichael Howell-312/+272
2023-01-28rustdoc: remove unused class `has-srclink`Michael Howell-17/+5
Stopped being used in CSS with 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0
2023-01-27rustdoc: merge doctest tooltip with notable traits tooltipMichael Howell-1/+1
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 Fixes #91100
2023-01-27Improve code readabilityGuillaume Gomez-1/+1
2023-01-27Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, ↵Yuki Okushi-2/+2
r=GuillaumeGomez rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2023-01-26rustdoc: remove mostly-unused CSS classes import/module-itemMichael Howell-2/+2
2023-01-23rustdoc: make item links consistently use `title="{shortty} {path}"`Michael Howell-1/+1
The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it inconsistent with the ordering in method signatures. Compare these: https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459 https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908
2023-01-22rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`Vadim Petrochenkov-10/+10
Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
2023-01-21Remove some superfluous type parameters from layout.rs.Michael Benfield-2/+2
Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-01-19Revert "Improve code readability"Guillaume Gomez-1/+1
This reverts commit eb93d1bedeab64c6f5d661df6a309a5b8a9273ca.
2023-01-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-1/+1
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-17Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, ↵Matthias Krüger-16/+16
r=GuillaumeGomez rustdoc: remove redundant item kind class from `.item-decl > pre` This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this PR is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-1/+1
2023-01-15rustdoc: simplify some & ref erencesMatthias Krüger-2/+2
2023-01-14rustdoc: remove redundant item kind class from `.item-decl > pre`Michael Howell-16/+16
This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this commit is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-14Rollup merge of #106855 - klensy:rd-s, r=notriddleMatthias Krüger-13/+12
rustdoc: few small cleanups
2023-01-14Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: remove `docblock` class from notable trait popover This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-14Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomezYuki Okushi-5/+5
rustdoc: remove unnecessary DOM class `h1.fqn` 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.
2023-01-13rustdoc: remove `docblock` class from notable trait popoverMichael Howell-1/+1
This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-13rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggleMichael Howell-7/+7
This swaps things around so that the class that gets used more often has the shorter name.