summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-12-12Add test for non-rust code block hashtag prepended linesGuillaume Gomez-0/+37
2022-12-12Don't take into account hashtag prepended lines if not in rust code blockGuillaume Gomez-3/+4
2022-10-29Rollup merge of #103663 - notriddle:notriddle/search-container, r=GuillaumeGomezMatthias Krüger-31/+24
rustdoc: remove redundant CSS/DOM `div.search-container` Preview: https://notriddle.com/notriddle-rustdoc-demos/search-container/test_dingus/fn.test.html This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-1/+1
privacy: Rename "accessibility levels" to "effective visibilities" And a couple of other naming and comment tweaks. Related to https://github.com/rust-lang/rust/issues/48054 For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often. So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
2022-10-28Rollup merge of #103643 - notriddle:notriddle/summary-focus-visible, ↵Matthias Krüger-4/+2
r=GuillaumeGomez rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-28Rollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddleMatthias Krüger-31/+17
Migrate source line numbers CSS to CSS variables Part of https://github.com/rust-lang/rust/pull/98460. No UI changes. r? ``@notriddle``
2022-10-27rustdoc: remove redundant `div.search-container`Michael Howell-31/+24
This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-27rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tagsMichael Howell-4/+2
We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-27Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomezMatthias Krüger-3/+1
rustdoc: remove CSS workaround for Firefox 29 CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Migrate line numbers CSS to CSS variablesGuillaume Gomez-31/+17
2022-10-27Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: remove redundant CSS selector `.notable-traits .notable` The margin was already being set to 0 only a few lines lower.
2022-10-26rustdoc: remove CSS workaround for Firefox 29Michael Howell-3/+1
CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Rollup merge of #103537 - notriddle:notriddle/line-numbers, r=GuillaumeGomezYuki Okushi-32/+19
rustdoc: combine shared CSS between `.*-line-numbers` Example: https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html This PR should result in no visible changes. The example is here, so it can be easily tested in different browsers.
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-26rustdoc: remove redundant CSS selector `.notable-traits .notable`Michael Howell-1/+1
The margin was already being set to 0 only a few lines lower.
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-1/+1
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-26Update src/librustdoc/html/static/css/rustdoc.cssMichael Howell-1/+2
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2022-10-25rustdoc: add visible focus outline to rustdoc-toggleMichael Howell-0/+8
The change in opacity is inconsistent with most of rustdoc, which uses default browser styles for the focus outline. Unfortunately, just using the default focus outline here won't work, because it gets applied to the summary itself instead of the pseudo-element "real button."
2022-10-25rustdoc: combine shared CSS between `.*-line-numbers`Michael Howell-32/+19
2022-10-25Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=GuillaumeGomezYuki Okushi-3/+0
rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-4/+6
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-24rustdoc: remove redundant CSS `a.test-arrow:hover`Michael Howell-3/+0
In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-24rustdoc: remove unused `.sidebar-logo` DOM on source pagesMichael Howell-4/+6
2022-10-23rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`Michael Howell-1/+0
This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
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-23Rollup merge of #103424 - ↵Michael Howell-1/+0
notriddle:notriddle/code-header-border-bottom-none, r=GuillaumeGomez rustdoc: remove no-op CSS `.code-header { border-bottom: none }` The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-22rustdoc: remove no-op CSS `.code-header { border-bottom: none }`Michael Howell-1/+0
The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-21rustdoc: remove unused CSS class `.result-description`Michael Howell-3/+3
It was added to the CSS in d8de2b4c338471aacaf0e8a096f9a7148b146ab4, but was never actually used in that PR.
2022-10-22Rollup merge of #103370 - notriddle:notriddle/out-of-band, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: remove unused CSS `.out-of-band { font-weight: normal }` This CSS was added in 083c3952e0d5473cd5c41a9eb7b4ffca18cc8e5f to normalize the appearance of out-of-band elements that were nested directly below headers. Now, the only use of `out-of-band` is in the main page header, and it is nested below a wrapper, not the `<h1>` itself.
2022-10-21rustdoc: remove unused CSS `.out-of-band { font-weight: normal }`Michael Howell-1/+0
This CSS was added in 083c3952e0d5473cd5c41a9eb7b4ffca18cc8e5f to normalize the appearance of out-of-band elements that were nested directly below headers. Now, the only use of `out-of-band` is in the main page header, and it is nested below a wrapper, not the `<h1>` itself.
2022-10-21rustdoc: prevent method summary margin from being applied to docblocksMichael Howell-2/+2
2022-10-21rustdoc: merge identical CSS blocksMichael Howell-8/+2
2022-10-21Rollup merge of #103321 - notriddle:notriddle/source-page-top-bar-layout, ↵Dylan DPC-44/+42
r=GuillaumeGomez rustdoc: improve appearance of source page navigation bar This commit changes things so that the search bar is exactly centered between the top of the page and the top of the source code content area. Preview: https://notriddle.com/notriddle-rustdoc-demos/source-page-header/src/std/lib.rs.html ## Before ![image](https://user-images.githubusercontent.com/1593513/197053420-02a64627-48ed-4bb6-9363-a1863d47b092.png) ## After ![image](https://user-images.githubusercontent.com/1593513/197053355-bd6149f9-0f5c-47da-aeb7-590b5eecb5da.png)
2022-10-20Rollup merge of #103296 - GuillaumeGomez:collapse-expand-shortcuts, r=notriddleMatthias Krüger-29/+30
+/- shortcut now only expand/collapse, not both Fixes https://github.com/rust-lang/rust/issues/102772. r? ```@notriddle```
2022-10-20rustdoc: improve appearance of source page navigation barMichael Howell-44/+42
This commit changes things so that the search bar is exactly centered between the top of the page and the top of the source code content area.
2022-10-20+/- shortcut now only expand/collapse, not bothGuillaume Gomez-29/+30
2022-10-20Rollup merge of #103268 - notriddle:notriddle/nav-sub-font-size, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }` This rule originated as a `font-size: 16px`, when body had `font-size: 13px` set in 4fd061c426902b0904c65e64a3780b21f9ab3afb. It remained even when body's font size was bumped up to 16px, 4d5f4ff5e9297dcad21612f9dd20ae4598b5b7e2, making the rule a no-op, and was carried forward when it was converted to 1rem in cc18120425a5c571a968d850c75cc935a8321136.
2022-10-20Rollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddleMatthias Krüger-20/+20
Fix item declaration highlighting Fixes https://github.com/rust-lang/rust/issues/103050. As mentioned in the issue, https://github.com/rust-lang/rust/pull/102924 introduced this regression. This PR partially reverts it and adds a regression test. r? `@notriddle`
2022-10-19rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`Michael Howell-1/+0
This rule originated as a `font-size: 16px`, when body had `font-size: 13px` set in 4fd061c426902b0904c65e64a3780b21f9ab3afb. It remained even when body's font size was bumped up to 16px, 4d5f4ff5e9297dcad21612f9dd20ae4598b5b7e2, making the rule a no-op, and was carried forward when it was converted to 1rem in cc18120425a5c571a968d850c75cc935a8321136.
2022-10-19Rollup merge of #103257 - notriddle:notriddle/setting-line, r=GuillaumeGomezMatthias Krüger-19/+19
rustdoc: move `setting-line` color CSS to settings.css
2022-10-19Rollup merge of #103211 - notriddle:notriddle/dot-location, r=GuillaumeGomezMatthias Krüger-28/+21
rustdoc: remove class name `location` from sidebar sibling nav Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-location/std/vec/struct.Vec.html 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. ## Before ![location-before](https://user-images.githubusercontent.com/1593513/196521014-d8730830-c3a2-4ed7-9266-05454cd31e05.png) ## After ![location-after](https://user-images.githubusercontent.com/1593513/196521020-75ec1fa5-b3dc-4c5d-97b6-afccb5fbe00a.png)
2022-10-19rustdoc: move `setting-line` color CSS to settings.cssMichael Howell-19/+19
2022-10-19Fix regression in item-decl highlightingGuillaume Gomez-20/+20
2022-10-19Auto merge of #103213 - matthiaskrgr:rollup-diloxg3, r=matthiaskrgrbors-24/+14
Rollup of 6 pull requests Successful merges: - #101889 (doc: rewrite doc for uint::{carrying_add,borrowing_sub}) - #102507 (More slice::partition_point examples) - #103164 (rustdoc: remove CSS ``@media` (min-width: 701px)`) - #103189 (Clean up code-color and headers-color rustdoc GUI tests) - #103203 (Retrieve LLVM version from llvm-filecheck binary if it is not set yet) - #103204 (Add some more autolabels) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-19Avoid cloning `RenderOptions`.Nicholas Nethercote-2/+1
By moving `RenderOptions` out of `Option`, because the two structs' uses are almost entirely separate. The only complication is that `unstable_features` is needed in both structs, but it's a tiny `Copy` type so its duplication seems fine.
2022-10-18rustdoc: remove class name `location` from sidebar sibling navMichael Howell-28/+21
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-17rustdoc: change mobile breakpoint to match CSSMichael Howell-3/+3
Since it's possible to have a 700.5px viewport width, the JS needs to not switch to mobile mode in such a setup.
2022-10-17rustdoc: remove CSS `@media (min-width: 701px)`Michael Howell-21/+11
The two rules within it can and should be done without the separate media query: * There ain't no rule saying a viewport can't be `700.5px` wide, since hardware pixels can be finer than CSS pixels. * The rule for the first example-wrap child should probably apply on mobile. * The rule for the source sidebar is overriden by the mobile rule setting `max-width: 100vw`, so it can be merged with the rest of the styles.
2022-10-17Rollup merge of #103162 - notriddle:notriddle/crate-search, r=GuillaumeGomezMatthias Krüger-4/+0
rustdoc: remove redundant CSS `#crate-search { border-radius }` This is the same border-radius that's always set on that ID: https://github.com/rust-lang/rust/blob/a9d1cafa878ecc04a4aa7aaa7df0414a29a2bd0b/src/librustdoc/html/static/css/rustdoc.css#L825-L836
2022-10-17Rollup merge of #103161 - ↵Matthias Krüger-12/+8
notriddle:notriddle/copy-path-settings-help-button, r=GuillaumeGomez rustdoc: remove redundant CSS on `#copy-path` The border and background were removed in 5d004c1e2020eaa9bc336f09b6b0475c0eef4d78, but not all the CSS was.