Michael Howell
f916681d8d
Only load one CSS theme by default
...
To avoid generating a FOUC at startup, this commit uses `document.write` to
load the stylesheet initially.
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2023-03-08 12:49:34 -07:00
Matthias Krüger
99fad38b19
Rollup merge of #108734 - clubby789:rustdoc-layout-uninhabited, r=GuillaumeGomez
...
rustdoc: Note in a type's layout/size if it is uninhabited
Closes #87008

2023-03-04 20:48:19 +01:00
Michael Howell
9d27028391
rustdoc: function signature search with traits in where clause
2023-03-04 09:05:57 -07:00
clubby789
7520155e4e
rustdoc: Note in a type's layout/size if it is uninhabited
2023-03-04 12:07:29 +00:00
Dylan DPC
4165de40f8
Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomez
...
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-19 13:03:41 +05:30
Kyle Matsuda
c183110cc2
remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata
2023-02-16 17:05:56 -07:00
Kyle Matsuda
d822b97a27
change usages of type_of to bound_type_of
2023-02-16 17:01:52 -07:00
Matthias Krüger
09ab35b574
Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddle
...
rustdoc: Use more let chain
Got the idea after yesterday's review.
r? `@notriddle`
2023-02-15 21:30:59 +01:00
Guillaume Gomez
86fd5a1b44
Use more let chain
2023-02-15 12:00:03 +01:00
Dylan DPC
9800dbe883
Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8Ki
...
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-15 12:24:54 +05:30
Michael Howell
a7b69ddea9
rustdoc: use a string with one-character codes for search index types
...
$ 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-13 14:27:00 -07:00
Matthias Krüger
3054759fa8
Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, 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:

2023-02-13 11:34:56 +01:00
Matthias Krüger
9b503325b4
Rollup merge of #107934 - 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-12 22:29:48 +01:00
Michael Howell
72b3f46b43
rustdoc: account for intra-doc links in <meta name="description">
2023-02-11 16:10:28 -07:00
Matthias Krüger
240d5e0f68
Rollup merge of #107864 - notriddle:notriddle/rustdoc-write-stutter, r=GuillaumeGomez
...
rustdoc: clean up `write!` calls with less stuttering
2023-02-11 17:18:43 +01:00
Dylan DPC
9af90ffa3c
Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, 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-11 11:15:55 +05:30
Matthias Krüger
d4d1c93730
Rollup merge of #107852 - notriddle:notriddle/rm-tab, r=GuillaumeGomez
...
rustdoc: remove unused fn parameter `tab`
2023-02-10 06:09:58 +01:00
Michael Howell
1a98305b9d
rustdoc: clean up write! calls with less stuttering
2023-02-09 18:13:02 -07:00
Dylan DPC
188dd72b5f
Rollup merge of #107655 - notriddle:notriddle/small-url-encode, r=GuillaumeGomez
...
rustdoc: use the same URL escape rules for fragments as for examples
Carries over improvements from #107284
2023-02-09 23:18:34 +05:30
Michael Howell
792b8464e7
rustdoc: remove unused fn parameter tab
2023-02-09 10:42:42 -07:00
Michael Howell
894c98652c
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-07 19:00:42 -07:00
Roland Strasser
71a147df1f
rustdoc: trait bound formatting
...
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-04 19:10:04 +01:00
Michael Howell
5f98a7f00e
rustdoc: use the same URL escape rules for fragments as for examples
2023-02-03 17:58:26 -07:00
Michael Goulet
f7210b3bed
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
...
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-03 14:15:23 -08:00
Michael Howell
784665d4ce
Replace nbsp in all rustdoc code blocks
...
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
2023-02-03 08:15:44 -07:00
bors
6c991b0740
Auto merge of #107000 - GuillaumeGomez:fix-items-in-doc-hidden-block, r=notriddle,petrochenkov
...
Fix handling of items inside a `doc(hidden)` block
Fixes #106373 .
cc `@aDotInTheVoid`
r? `@notriddle`
2023-02-02 21:14:44 +00:00
Michael Howell
f75b350467
rustdoc: stop making unstable items transparent
...
Fixes #93393
2023-01-31 11:27:09 -07:00
Michael Howell
3a20cbf9fc
rustdoc: remove inconsistently-present sidebar tooltips
...
Discussed in
https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-01-31 10:12:13 -07:00
Yuki Okushi
e776a63956
Rollup merge of #107482 - notriddle:notriddle/keywords, r=jsha
...
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-31 11:46:26 +09:00
Michael Howell
f5bac0c4c8
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-30 12:20:06 -07:00
Michael Howell
7080f80e8b
rustdoc: remove unnecessary wrapper div.item-decl from HTML
2023-01-30 11:06:18 -07:00
Michael Howell
74e843c833
rustdoc: remove unused class has-srclink
...
Stopped being used in CSS with
73d0f7c7b6
2023-01-28 17:18:56 -07:00
Michael Howell
7aa4a205a8
rustdoc: merge doctest tooltip with notable traits tooltip
...
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000
Fixes #91100
2023-01-27 09:04:39 -07:00
Guillaume Gomez
9f70bdcbc8
Improve code readability
2023-01-27 14:41:33 +01:00
Yuki Okushi
17a2e1fef3
Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez
...
rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2023-01-27 12:57:57 +09:00
Michael Howell
97f8189614
rustdoc: remove mostly-unused CSS classes import/module-item
2023-01-26 12:55:19 -07:00
Michael Howell
57ca36861d
rustdoc: make item links consistently use title="{shortty} {path}"
...
The ordering in item tables was flipped in 3030cbea95 , making it
inconsistent with the ordering in method signatures.
Compare these:
c8e6a9e8b6/src/librustdoc/html/render/print_item.rs (L455-L459)
c8e6a9e8b6/src/librustdoc/html/format.rs (L903-L908)
2023-01-23 14:31:35 -07:00
Vadim Petrochenkov
68803926e0
rustdoc: Use DefId(Map,Set) instead of FxHash(Map,Set)
...
Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
2023-01-22 02:12:05 +04:00
Michael Benfield
8df27d07ae
Remove some superfluous type parameters from layout.rs.
...
Specifically remove V, which can always be VariantIdx, and F, which can
always be Layout.
2023-01-21 10:22:31 -08:00
Guillaume Gomez
8b80bc1bf4
Revert "Improve code readability"
...
This reverts commit eb93d1bede .
2023-01-19 20:26:01 +01:00
bors
65d2f2a5f9
Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkov
...
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-19 05:23:40 +00:00
Matthias Krüger
b90f62988d
Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, 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.
4fd061c426/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-17 05:25:22 +01:00
Oli Scherer
9f5cd03153
Move compiler input and ouput paths into session
2023-01-16 14:46:44 +00:00
Matthias Krüger
fdd6af14a1
rustdoc: simplify some & ref erences
2023-01-15 15:23:30 +01:00
Michael Howell
3a3f70c94e
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.
4fd061c426/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-14 11:34:03 -07:00
Matthias Krüger
bc0c816410
Rollup merge of #106855 - klensy:rd-s, r=notriddle
...
rustdoc: few small cleanups
2023-01-14 18:45:28 +01:00
Matthias Krüger
14fbc21466
Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, r=GuillaumeGomez
...
rustdoc: remove `docblock` class from notable trait popover
This commit builds on b72de9be74 , which removes the `docblock` class from the All Items page, and 9457380ac9 , which removes the `docblock` class from the item decl.
Fixes #92974
2023-01-14 18:45:27 +01:00
Yuki Okushi
caa1d47fba
Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomez
...
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-14 12:04:37 +09:00
Michael Howell
5314ed5627
rustdoc: remove docblock class from notable trait popover
...
This commit builds on b72de9be74 , which removes
the `docblock` class from the All Items page, and
9457380ac9 , which removes the `docblock` class
from the item decl.
Fixes #92974
2023-01-13 15:42:29 -07:00
Michael Howell
1d328de3ec
rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle
...
This swaps things around so that the class that gets used more often has
the shorter name.
2023-01-13 12:38:03 -07:00