| Age | Commit message (Collapse) | Author | Lines |
|
Part of #87059
Partially reverts #84703
Heavily modified for beta backport needs.
|
|
|
|
Part of #87059
Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
|
|
|
|
Type page font weight
Fixes https://github.com/rust-lang/rust/issues/86069.
r? ```@jsha```
|
|
|
|
|
|
Sidebar unification
This PR does a few things:
* Put crates list at all levels (before, it was only on the "top" items)
* Fix bug in module sidebar: the list of items was from the parent module.
The other changes (on bootstrap mostly) were to allow to generate multiple crates in a same folder so that we can ensure that clicking on the crates in the sidebar works as expected.
I added a rustdoc-gui test to ensure everything is where it should be.
r? `@jyn514`
|
|
|
|
|
|
|
|
|
|
In the meantime, allow all of the details to have the same top.
|
|
|
|
Avoid CJK legacy fonts in Windows
As metioned in #84035, the default serif CJK font in Windows is meh-looking.
To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
|
|
|
|
Restore sans-serif font for module items.
This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).
Fixes #85616.
Fixes https://github.com/rust-lang/rust/issues/85545.
r? `@camelid`
|
|
Fix search results display
Fixes https://github.com/rust-lang/rust/issues/85544.
cc `@dns2utf8`
r? `@jsha`
|
|
This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: restore header sizes
The `<details>` toggle work changed the relationship from #main to the top-doc docblock so it was no longer a parent relationship but a great-grandparent relationship. This updates the CSS rules that set the heading sizes so they still apply.
Fixes #85389
r? ``@camelid``
|
|
Improve display for "copy-path" button, making it more discreet
As suggested by `@Nemo157` [here](https://github.com/rust-lang/rust/pull/85118#issuecomment-838887670):






r? `@jsha`
|
|
rustdoc: use focus for search navigation
Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class.
This required wrapping each row of results in one big `<a>` tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float.
This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements.
This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focus. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus.
Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is
controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't.
Demo at https://hoffman-andrews.com/rust/focus-search-results2/std/?search=fn
Fixes #84384
Fixes #79962
Fixes #79872
|
|
|
|
|
|
Fix toggle position on mobile
Before:


After:


r? ```@jsha```
|
|
Fix display for "implementors" section
Just saw this problem when going through docs:

This fix puts it back to normal:

You can see it on the `TryFrom` page for example.
r? ```@Nemo157```
|
|
|
|
|
|
|
|
|
|
|
|
Rather than keeping track of highlighted element inside the JS, take
advantage of `.focus()` and the :focus CSS pseudo-class.
This required wrapping each row of results in one big <a> tag (because
anchors can be focused, but table rows cannot). That in turn required
moving from a table layout to a div layout with float.
This makes it so Ctrl+Enter opens links in new tabs, and using the arrow
keys to navigate off the bottom of the page scrolls the rest of the page
into view. It also simplifies the keyboard event handling. It eliminates
the need for click handlers on the search results, and for tracking
mouse movements.
This changes the UI treatment of mouse hovering. A hovered element now
gets a light grey background, but does not change the focused element.
It's possible to have two highlighted search results: one that is
focused (via keyboard) and one that is hovered (via mouse). Pressing
enter will activate the focused link; clicking will activate the hovered
link. This matches up with how Firefox and Chrome handle suggestions in
their URL bar, and avoids stray mouse movements changing the focus.
Selecting tabs is now done with left/right arrows while any search
result is focused. The visibility of results on each search tab is
controlled with the "active" class, rather than by setting display: none
directly. Note that the old code kept track of highlighted search
element when tabbing back and forth. The new code doesn't.
|
|
Rustdoc cleanup
Part of https://github.com/rust-lang/rust/issues/83332. The goal of this PR is to remove a few unused things:
* The "loading content" things are now unneeded.
* Some toggle CSS rules were still there.
* Some parts of the JS had a different indent, fixed it.
r? `@jsha`
|
|
|
|
Fix border radius for doc code blocks in rustdoc
In #85148, I made an invalid change on the border radius of the doc code blocks (look in the top left and bottom left corners of the code blocks).
Before this fix:

After this fix:

r? `@jsha`
|
|
|
|
|
|
In rustdoc's main.js, we had an onclick handler for the whole document
that would dispatch to handlers for various elements. This change
attaches the handlers to the elements that trigger them, instead.
This simplfies the code and avoids reimplementing the browser's bubbling
functionality.
As part of this change, change from a class to an id for help button.
Move the handlers and associated code for highlighting source lines into
source-script.js (and factor out a shared regex).
|
|
|
|
Fix source code line number display and make it clickable again
Fixes https://github.com/rust-lang/rust/issues/85119.
I used the same logic we're using for other codeblocks: putting the line number `<span>`s into the `example-wrap` directly and then add `display: inline-flex` on `example-wrap`.
r? `@jsha`
|
|
|
|
|
|
|