| Age | Commit message (Collapse) | Author | Lines |
|
Unify search input and buttons size
Fixes #93060.
Here what it looks like:


You can test it [here](https://rustdoc.crud.net/imperio/unify-sizes/std/index.html).
r? ``@jsha``
|
|
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``
|
|
|
|
rustdoc: remove dashed underline under main heading
This was removed in #92797 but accidentally re-introduced by a bad merge in #92861.
r? ```@camelid```
|
|
|
|
|
|
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`
|
|
|
|
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
|
|
For all table layouts, set overflow-wrap: break-word.
|
|
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`
|
|
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.
|
|
|
|
They are not needed to separate the search bar and the title, which are
visually distinct on their own.
|
|
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.
|
|
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`
|
|
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
|
|
- 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.
|
|
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.
|
|
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.
|
|
Make source links look cleaner
Change from syntaxy-looking [src] to the plain word "source".
Change the syntaxy-looking `[-]` at the top of the page to say "collapse".
Reduce opacity of rightside content.
Part of #59851
r? `@GuillaumeGomez`
Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
|
|
Move crate drop-down to search results page
This reduces clutter on doc pages.
Part of #59840
r? ```@GuillaumeGomez```
Demo: https://rustdoc.crud.net/jsha/crates-in-results/std/index.html?search=str
|
|
Change from syntaxy-looking [src] to the plain word "source".
|
|
r=jsha
Create CSS class instead of using inline style for search results
I saw this change in the update you proposed in https://github.com/rust-lang/rust/pull/92404. :)
r? ``@jsha``
|
|
|
|
Fix font size for [src] links in headers
Fixes #90384.
cc `@jsha`
r? `@camelid`
|
|
Make Run button visible on hover
This slightly reduces the noisiness of doc pages, making them easier to read.
Demo: https://rustdoc.crud.net/jsha/run-on-hover/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.22Run.22.20button.20visible.20on.20hover).
Part of #59845
|
|
This reduces clutter on doc pages.
|
|
|
|
This slightly reduces the noisiness of doc pages, making them easier to
read.
|
|
According to MDN
(https://developer.mozilla.org/en-US/docs/Web/CSS/font-size),
> To maximize accessibility, it is generally best to use values that
> are relative to the user's default font size.
> Defining font sizes in px is not accessible, because the user cannot
> change the font size in some browsers.
Note that changing font size (in browser or OS settings) is distinct
from the zoom functionality triggered with Ctrl/Cmd-+. Zoom
functionality increases the size of everything on the page, effectively
applying a multiplier to all pixel sizes. Font size changes apply to
just text.
For relative font sizes, we could use `em`, as we do in several places
already. However that has a problem of "compounding" (see MDN article
for details). The compounding problem is nicely solved by `rem`, which
make font sizes relative to the root element, not the parent element.
Since we were using a hodge-podge of pixel sizes, em, rem, and
percentage sizes before, this change switching everything to rem, while
keeping the same size relative to our old default of 16px.
16px is still the default on most browsers, for users that haven't set a
larger or smaller font size.
|
|
|
|
Fix source code page sidebar on mobile
Current broken behaviour:
https://user-images.githubusercontent.com/3050060/145984316-35c82353-5bab-4dc6-9ac6-63ea7e5c27d8.mp4
Fixed:
https://user-images.githubusercontent.com/3050060/145984329-8be1127b-d707-424d-ac3c-c1fb3c48a093.mp4
r? `@jsha`
|
|
|
|
Add `-webkit-appearance: none` to search input
This fixes an issue when displaying on iPad, where the search box had no borders.
r? ``@GuillaumeGomez``
Demo https://rustdoc.crud.net/jsha/webkit-appearance-search-input/std/string/struct.String.html
|
|
This fixes an issue when displaying on iPad, where the search box had no
borders.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: Consolidate static-file replacement mechanism
There were a few places in rustdoc where we would take static JS or CSS and rewrite it at doc generation time to insert values. This consolidates all the CSS instances into one CSS file and replaces the JS examples with data- attributes on the rustdoc-vars div.
Demo https://rustdoc.crud.net/jsha/static-file-replace/test_docs/
r? ``@GuillaumeGomez``
|
|
heading of the top doc block
|
|
|