summary refs log tree commit diff
path: root/src/librustdoc/html/render/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-1/+1
2023-01-14Rollup merge of #106855 - klensy:rd-s, r=notriddleMatthias Krüger-3/+3
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-2/+2
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-4/+4
This swaps things around so that the class that gets used more often has the shorter name.
2023-01-13rustdoc: remove unnecessary DOM class `h1.fqn`Michael Howell-2/+2
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-13IndexItem.name String -> Symbolklensy-1/+1
2023-01-13evade clonesklensy-2/+2
2022-12-21rustdoc: simplify CSS and DOM for more-scraped-examplesMichael Howell-3/+2
This gets rid of the more-scraped-examples-inner wrapper, instead nesting the children directly and using absolute positioning for the toggle line.
2022-12-16Don't add "Read more" link if there is no extra contentGuillaume Gomez-2/+3
2022-12-12rustdoc: stop treating everything in a trait item as a methodMichael Howell-2/+1
This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the spacing on trait pages, but stopped being needed because 791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.
2022-12-07Update scrape-examples help, fix documentation typosWill Crichton-7/+8
2022-12-07Improve several aspects of the Rustdoc scrape-examples UI.Will Crichton-5/+13
* Examples take up less screen height. * Snippets from binary crates are prioritized. * toggle-all-docs does not expand "More examples" sections.
2022-11-28rustdoc: remove `fnname` CSS class that's styled exactly like `fn`Michael Howell-2/+2
It's not obvious why this was ever a separate class name, since even in c4219a478354b464079b1b7ab081e071e8e39765 when it was first added, it was styled identically to regular `fn` links.
2022-11-23Improve accessibility:Guillaume Gomez-6/+6
* Set aria-label attribute on search input * Put anchor text directly into the DOM and not in the CSS
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-4/+4
2022-11-19rustdoc: use real buttons for scrape examples controlsMichael Howell-1/+1
2022-11-13Rollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, ↵Yuki Okushi-4/+2
r=GuillaumeGomez rustdoc: use consistent "popover" styling for notable traits Follow-up to #104129 Fixes https://github.com/rust-lang/rust/issues/104313. Preview: https://notriddle.com/notriddle-rustdoc-demos/js-notable-trait-v2/std/iter/trait.Iterator.html#method.step_by ## Before ![image](https://user-images.githubusercontent.com/1593513/200710372-d2d992ce-0bdc-4437-9a2e-379a29df09cf.png) ![image](https://user-images.githubusercontent.com/1593513/200711266-e372b176-daa9-45f3-a022-738ef0a77d3c.png) ## After ![image](https://user-images.githubusercontent.com/1593513/200710601-09b3b717-116f-43c6-b14f-34a8b02b33c0.png) ![image](https://user-images.githubusercontent.com/1593513/200711288-3978cdc1-a6c2-47f6-9216-e22e3c1f5bdf.png)
2022-11-13Rollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomezYuki Okushi-4/+1
rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a` Example: https://notriddle.com/notriddle-rustdoc-demos/line-anchors/test_dingus/fn.test.html This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
2022-11-12rustdoc: avoid excessive HTML generated in example sourcesMichael Howell-5/+1
2022-11-11rustdoc: use consistent "popover" styling for notable traitsMichael Howell-4/+2
2022-11-11rustdoc: fix HTML validation failure by escaping `data-ty`Michael Howell-2/+2
2022-11-09rustdoc: sort output to make it deterministicMichael Howell-1/+2
2022-11-07rustdoc: use javascript to layout notable traits popupsMichael Howell-48/+97
Fixes #102576
2022-11-07rustdoc: refactor `notable_traits_decl` to just act on the type directlyMichael Howell-67/+66
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-4/+4
2022-10-31rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`Michael Howell-5/+6
This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
2022-10-30Make rustdoc Item::visibility computed on-demandGuillaume Gomez-5/+7
2022-10-29Fix z-indexes of code example feature and cleanup its CSSGuillaume Gomez-5/+1
2022-10-27Rollup merge of #103432 - jsha:box-is-not-notable, r=GuillaumeGomezYuki Okushi-0/+9
rustdoc: don't mark Box<T> as Iterator, Read, etc Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future. Fixes #100320
2022-10-23rustdoc: don't mark Box<T> as Iterator, Read, etcJacob Hoffman-Andrews-0/+9
Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future.
2022-10-18rustdoc: remove class name `location` from sidebar sibling navMichael Howell-1/+1
This change tweaks the CSS to apply most of its styles to `.sidebar h2`, cleaning up a few redundant rules from `.mobile-topbar .location` and restoring useful navigation aids in mobile mode.
2022-10-15rustdoc: remove unused HTML class `sidebar-title`Michael Howell-7/+1
Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.
2022-10-10Remove outdated commentMichael Howell-1/+0
2022-10-10rustdoc: remove unneeded `<div>` wrapper from sidebar DOMMichael Howell-16/+7
When this was added, the sidebar had a bit more complex style. It can be removed, now.
2022-10-05rustdoc: remove unused CSS class `in-band`Michael Howell-8/+2
Since a7c25b29575c17434406b69773f8c2961af343b3 removed `in-band` from code headers, the only remaining uses of the `in-band` class are: https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/write_shared.rs#L520-L521 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/templates/print_item.html#L2-L3 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/context.rs#L637-L638 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L368-L369 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L401-L402 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/static/js/main.js#L525 Since all of these uses are nested below `h1.fqn`, we can get rid of it, and the support code that was used for when `in-band` was part of item rendering.
2022-09-27rustdoc: remove `clean::TraitWithExtraInfo`Michael Howell-3/+8
Instead, it gathers the extra info later, when it's actually requested.
2022-09-25rustdoc: clean up `.out-of-band`/`.in-band` CSSMichael Howell-1/+1
* Remove the `float: right` fallback from the main header, which hasn't been needed since IE11 support was dropped. * Remove `in-band` from low-level headers, which hasn't been needed since `.rightside` switched to `float: right` in 593d6d1cb15c55c88319470dabb40126c7b7f1e2 * Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since the `in-band` class was attached to the `code-header` itself, not nested directly below it. * Use `rem` instead of `em` for code header margins. * This results in a slight change in spacing around impls and item-info, but since it makes it more consistent with the way methods are presented, it's probably fine.
2022-09-23Rollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomezMatthias Krüger-9/+4
rustdoc: clean up CSS/DOM for deprecation warnings Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html
2022-09-22rustdoc: clean up CSS/DOM for deprecation warningsMichael Howell-9/+4
2022-09-22Improve some AllTypes fields nameGuillaume Gomez-10/+12
2022-09-20Unify generation of section on "All items" page with all other pagesGuillaume Gomez-18/+18
2022-09-20Generate sidebar elements for the "All items" pageGuillaume Gomez-18/+70
2022-09-16rustdoc: clean up CSS for All Items and All Crates listsMichael Howell-18/+17
This reduces the amount of CSS, and makes these two pages more consistent (which, necessarily, means changing them a bit).
2022-09-03more clippy::perf fixesMatthias Krüger-2/+2
2022-09-01Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, ↵Matthias Krüger-6/+6
r=notriddle Remove unneeded where whitespace It fixes these two bugs: ![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png) ![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png) It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8). You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html). cc `````````@jsha````````` r? `````````@notriddle`````````
2022-08-31Remove unneeded extra whitespace before where clauseGuillaume Gomez-6/+6
2022-08-31Rollup merge of #101204 - aDotInTheVoid:async-resugar-in-clean, r=GuillaumeGomezRalf Jung-1/+1
rustdoc: Resugar async fn return type in `clean`, not `html` This way it also happens for json output. Fixes #101199 r? ``@GuillaumeGomez``
2022-08-31Print only blanket implementations on reference primitive typeGuillaume Gomez-62/+118