about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-01-25give light-theme fns the correct orange-brown colourConrad Ludgate-1/+1
2022-01-25Rollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomezMatthias Krüger-50/+78
rustdoc settings: use radio buttons for theme This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon. Demo: https://rustdoc.crud.net/jsha/theme-radio/settings.html r? ``@GuillaumeGomez`` New: ![image](https://user-images.githubusercontent.com/220205/150702647-4826d525-54fa-439a-b24c-6d5bca6f95bf.png) Old: ![image](https://user-images.githubusercontent.com/220205/150702669-6a4214ed-1dab-4fee-b1aa-59acfce3dbca.png)
2022-01-24Add white-space: nowrap to links in the sidebarJacob Hoffman-Andrews-0/+4
We already have overflow: hidden on these links, but if there is a possibility to wrap, they will wrap. This happens in particular for trait implementations because the punctuation (`<>, `) introduces opportunities for breaks. That produces inconsistent UI. Fix it by forcing them not to wrap.
2022-01-24Rollup merge of #93253 - jsha:theme-on-show, r=GuillaumeGomezMatthias Krüger-6/+25
Update theme on pageshow event When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event. Demo: https://rustdoc.crud.net/jsha/theme-on-show/std/string/trait.ToString.html r? `@GuillaumeGomez`
2022-01-24Rollup merge of #93241 - GuillaumeGomez:rust-logo-appearance, r=jshaMatthias Krüger-1/+1
Fix brief appearance of rust logo in the sidebar Part of #91374. I simply removed the CSS animation on the visibility, which now makes it all appear at once. I didn't change the CSS animation on the width though, which gives: https://user-images.githubusercontent.com/3050060/150689595-067a6e00-9875-40c8-9d8a-1e3031dbcaba.mp4 cc `@camelid` r? `@jsha`
2022-01-24Rollup merge of #93231 - conradludgate:doc-link-brightness, r=notriddleMatthias Krüger-0/+67
adjust sidebar link brightness Fairly simple change. I've taken the existing link colour and main body background colours, and made sure that the sidebar+link contrast is the same. ayu: - [main content contrast](https://colourcontrast.cc/0f1419/39afd7) - 7.31 - [current sidebar contrast](https://colourcontrast.cc/14191f/39afd7) - 6.97 - [new sidebar contrast](https://colourcontrast.cc/14191f/56b1d9) - 7.30 dark: - [main content contrast](https://colourcontrast.cc/353535/d2991d) - 4.86 - [current sidebar contrast](https://colourcontrast.cc/14191f/d2991d) - 3.19 - [new sidebar contrast](https://colourcontrast.cc/14191f/fdbf35) - 4.87 light: - [main content contrast](https://colourcontrast.cc/ffffff/3873ad) - 4.97 - [current sidebar contrast](https://colourcontrast.cc/f5f5f5/3873ad) - 4.56 - [new sidebar contrast](https://colourcontrast.cc/f5f5f5/356da4) - 4.97
2022-01-24Rollup merge of #93212 - GuillaumeGomez:cursor-pointer-mobile-sidebar, r=jshaMatthias Krüger-1/+0
Remove unneeded cursor pointer rule on mobile sidebar Since it's on mobile, there isn't much point in this rule... r? `@jsha`
2022-01-24Rollup merge of #93188 - jsha:fix-safari-bumpy-search, r=camelidMatthias Krüger-0/+1
rustdoc: fix bump down typing search on Safari Fixes #93184. For some reason, if the search input doesn't have a previous sibling, typing in the search box increases the search-container's size by about 5px on the bottom. Putting in a dummy sibling fixes it. https://rustdoc.crud.net/jsha/fix-safari-bumpy-search/std/string/struct.String.html r? `@camelid`
2022-01-23Update theme on pageshow eventJacob Hoffman-Andrews-6/+25
When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event.
2022-01-23rustdoc settings: use radio buttons for themeJacob Hoffman-Andrews-50/+78
This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon.
2022-01-23rustdoc: fix bump down typing search on SafariJacob Hoffman-Andrews-0/+1
2022-01-23Rollup merge of #93229 - mark-i-m:noquiet, r=eddybMatthias Krüger-5/+7
Remove DiagnosticBuilder.quiet r? `@eddyb` cc https://github.com/rust-lang/rust/issues/69426 `@GuillaumeGomez` `@Manishearth`
2022-01-23Fix brief appearance of rust logo in the sidebarGuillaume Gomez-1/+1
2022-01-23remove duplicate ruleConrad Ludgate-6/+0
2022-01-23tweak all sidebar coloursConrad Ludgate-3/+67
2022-01-23adjust sidebar link brightnessConrad Ludgate-0/+9
2022-01-23Remove DiagnosticBuilder.quietmark-5/+7
2022-01-23Rollup merge of #93185 - camelid:crate-private, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc: Make some `pub` items crate-private They don't need to be `pub`. Making them crate-private improves code clarity and `dead_code` linting.
2022-01-23Rollup merge of #93113 - GuillaumeGomez:unify-sizes, r=jshaMatthias Krüger-106/+33
Unify search input and buttons size Fixes #93060. Here what it looks like: ![Screenshot from 2022-01-20 21-38-19](https://user-images.githubusercontent.com/3050060/150418571-fefd6538-b3ee-4dd2-b77b-77e96bcfa0ed.png) ![Screenshot from 2022-01-20 21-38-22](https://user-images.githubusercontent.com/3050060/150418570-53ba259b-9bd4-4084-8b43-d74a5752d712.png) You can test it [here](https://rustdoc.crud.net/imperio/unify-sizes/std/index.html). r? ``@jsha``
2022-01-23Rollup merge of #93068 - jsha:dot-spacing, r=GuillaumeGomezMatthias Krüger-2/+1
Fix spacing for `·` between stability and source This puts in an actual space (by adjusting the space-eating operators in our templates), updates the test, and remove the now-unnecessary CSS rule. r? ``@GuillaumeGomez``
2022-01-22Remove unneeded cursor pointer rule on mobile sidebarGuillaume Gomez-1/+0
2022-01-22Rollup merge of #93172 - jsha:re-remove-line, r=camelidMatthias Krüger-1/+0
rustdoc: remove dashed underline under main heading This was removed in #92797 but accidentally re-introduced by a bad merge in #92861. r? ```@camelid```
2022-01-21rustdoc: Make some `pub` items crate-privateNoah Lev-1/+1
They don't need to be `pub`. Making them crate-private improves code clarity and `dead_code` linting.
2022-01-21Fix spacing for `·` between stability and sourceJacob Hoffman-Andrews-2/+1
2022-01-21Unify search input and buttons sizeGuillaume Gomez-106/+33
2022-01-21Rollup merge of #93139 - jsha:fix-wrapped-names, r=Nemo157Matthias Krüger-5/+25
rustdoc: fix overflow-wrap for table layouts For all table layouts, set overflow-wrap: break-word. Fixes #93135 Demo: https://rustdoc.crud.net/jsha/fix-wrapped-names/std/intrinsics/index.html#functions (Compare vs https://doc.rust-lang.org/nightly/std/intrinsics/index.html - you may have to make your browser narrower to see the effect) r? `@Nemo157`
2022-01-21rustdoc: remove dashed underline under main headingJacob Hoffman-Andrews-1/+0
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-2/+2
2022-01-21Auto merge of #93138 - matthiaskrgr:rollup-m8akifd, r=matthiaskrgrbors-1/+8
Rollup of 17 pull requests Successful merges: - #91032 (Introduce drop range tracking to generator interior analysis) - #92856 (Exclude "test" from doc_auto_cfg) - #92860 (Fix errors on blanket impls by ignoring the children of generated impls) - #93038 (Fix star handling in block doc comments) - #93061 (Only suggest adding `!` to expressions that can be macro invocation) - #93067 (rustdoc mobile: fix scroll offset when jumping to internal id) - #93086 (Add tests to ensure that `let_chains` works with `if_let_guard`) - #93087 (Fix src/test/run-make/raw-dylib-alt-calling-convention) - #93091 (⬆ chalk to 0.76.0) - #93094 (src/test/rustdoc-json: Check for `struct_field`s in `variant_tuple_struct.rs`) - #93098 (Show a more informative panic message when `DefPathHash` does not exist) - #93099 (rustdoc: auto create output directory when "--output-format json") - #93102 (Pretty printer algorithm revamp step 3) - #93104 (Support --bless for pp-exact pretty printer tests) - #93114 (update comment for `ensure_monomorphic_enough`) - #93128 (Add script to prevent point releases with same number as existing ones) - #93136 (Backport the 1.58.1 release notes to master) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-20rustdoc: fix overflow-wrap for table layoutsJacob Hoffman-Andrews-5/+25
For all table layouts, set overflow-wrap: break-word.
2022-01-20Rollup merge of #93067 - jsha:fix-scroll-padding-top, r=GuillaumeGomezMatthias Krüger-1/+8
rustdoc mobile: fix scroll offset when jumping to internal id Followup to #92692. The semantics of `scroll-margin-top` are a little surprising - the attribute needs to be applied to the element that gets scrolled into the viewport, not the scrolling element. This fixes an issue where clicking on a method (or other item) from the sidebar takes you to a scroll position where the topbar covers up the method name. I'm interested in ideas for how to test this with browser-ui-test, but I think it doesn't yet have what I need. What I need is an assert that `<element>.getBoundingClientRect().y` is > 45. Demo: https://rustdoc.crud.net/jsha/fix-scroll-padding-top/std/string/struct.String.html#method.extend_from_within r? `@GuillaumeGomez`
2022-01-20Rollup merge of #92861 - jsha:mobile-column-flex, r=GuillaumeGomezMatthias Krüger-9/+20
Rustdoc mobile: put out-of-band info on its own line Before this, the item name and the stability, source link, and "collapse all docs" would compete for room on a single line, resulting in awkward wrapping behavior on mobile. This gives a separate line for that out-of-band information. It also removes the "copy path" icon on mobile to make a little more room. Demo: https://rustdoc.crud.net/jsha/mobile-column-flex/std/string/struct.String.html r? `@GuillaumeGomez`
2022-01-20Rollup merge of #91694 - euclio:stability-improvements, r=GuillaumeGomezMatthias Krüger-36/+55
rustdoc: decouple stability and const-stability This PR tweaks the stability rendering code to consider stability and const-stability separately. This fixes two issues: - Stabilities that match the enclosing item are now always omitted, even if the item has const-stability as well (#90552) - Const-stable unstable functions will now have their (const-) stability rendered. Fixes #90552.
2022-01-19Rustdoc mobile: put out-of-band on its own lineJacob Hoffman-Andrews-9/+20
Before this, the item name and the stability, source link, and "collapse all docs" would compete for room on a single line, resulting in awkward wrapping behavior on mobile. This gives a separate line for that out-of-band information. It also removes the "copy path" icon on mobile to make a little more room. Also, switch to flex-wrap: wrap, so anytime there's not enough room for `source`, it gets bumped to the next line.
2022-01-19Fix scroll offset when jumping to internal idJacob Hoffman-Andrews-1/+8
2022-01-19Rollup merge of #93005 - GuillaumeGomez:templates-in-html, r=notriddleMatthias Krüger-0/+219
Move back templates into html folder Follow-up of https://github.com/rust-lang/rust/pull/92526. r? `@notriddle`
2022-01-19Move back templates into html folderGuillaume Gomez-0/+219
2022-01-18Remove horizontal lines at top of pageJacob Hoffman-Andrews-12/+0
They are not needed to separate the search bar and the title, which are visually distinct on their own.
2022-01-18Simplify and unify rustdoc sidebar stylesJacob Hoffman-Andrews-329/+161
This switches to just use size, weight, and spacing to distinguish headings in the sidebar. We no longer use boxes, horizontal bars, or centering to distinguish headings. This makes it much easier to understand the hierarchy of headings, and reduces visual noise. I also refactored how the mobile topbar works. Previously, we tried to shift around elements from the sidebar to make the topbar. Now, the topbar gets its own elements, which can be styled on their own. This makes styling and reasoning about those elements simpler. Because the heading font sizes are bigger, increase the sidebar width slightly. As a very minor change, removed version from the "All types" page. It's now only on the crate page.
2022-01-18Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obkbors-3/+15
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
2022-01-18Rollup merge of #92830 - jsha:style-cleanups, r=GuillaumeGomezMatthias Krüger-41/+21
Rustdoc style cleanups - Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown Demo: https://rustdoc.crud.net/jsha/style-cleanups/std/string/struct.String.html r? `@GuillaumeGomez`
2022-01-18Rollup merge of #92803 - jsha:hide-sidebar, r=GuillaumeGomezMatthias Krüger-0/+4
Hide mobile sidebar on some clicks When the user clicks outside the sidebar, the sidebar should close. Also, when the user clicks an internal link in the sidebar, it should close. Fixes #92682 Demo: https://rustdoc.crud.net/jsha/hide-sidebar/std/string/struct.String.html
2022-01-18Rollup merge of #92629 - jsha:theme-picker-local-only-2, r=GuillaumeGomezMatthias Krüger-15/+52
Pick themes on settings page, not every page This hides the paintbrush icon on most pages by default, in preference for the settings on the settings page. When loading from a local file, and not in mobile view, continue to show the theme picker. That's because some browsers limit access to localStorage from file:/// URLs, so choosing a theme from settings.html doesn't take effect. Fixes #84539 Part of #59840 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/theme-picker-local-only-2/std/io/trait.Read.html
2022-01-17Hide mobile sidebar on some clicksJacob Hoffman-Andrews-0/+4
When the user clicks outside the sidebar, the sidebar should close. Also, when the user clicks an internal link in the sidebar, it should close.
2022-01-17Update term for use in more placeskadmin-3/+15
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
2022-01-17Rustdoc style cleanupsJacob Hoffman-Andrews-46/+21
- Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown.
2022-01-17Rollup merge of #92936 - vacuus:html-markdown-parse, r=GuillaumeGomezMatthias Krüger-3/+1
rustdoc: Remove `collect` in `html::markdown::parse`
2022-01-17Rollup merge of #92801 - jsha:overflow-wrap, r=GuillaumeGomezMatthias Krüger-0/+16
Enable wrapping words by default Faced with a very long word, browsers will let it overflow its box horizontally rather than break it in the middle. We essentially never want that behavior. We would rather break the word and keep it inside its horizontal limits. So we apply a default overflow-wrap: break-word/anywhere to the document as a while. In some contexts we would rather add a horizontal scrollbar (code blocks), or elide the excess text with an ellipsis (sidebar). Those still work as expected. Fixes #92771 [Some related discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/wrap.20.2F.20overflow.20.2F.20scroll) and a related issue: #92421. Demo: https://rustdoc.crud.net/jsha/overflow-wrap/std/iter/trait.Iterator.html#method.try_find r? ``@GuillaumeGomez``
2022-01-17Auto merge of #90986 - camsteffen:nested-filter, r=cjgillotbors-4/+5
Replace `NestedVisitorMap` with generic `NestedFilter` This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting. With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted). One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.
2022-01-17Correctly handle pure genericsGuillaume Gomez-4/+6