| Age | Commit message (Collapse) | Author | Lines |
|
Improve URLs handling
Fixes #81330.
Explanations: before this PR, when emptying the search input, we still had `?search=` in the URL, which wasn't very nice. Now, if the search is empty, we drop the `?search=` part.
Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: `?search=#the-anchor`, which was super weird. Now, it looks like this: `?search=the-search#the-anchor`.
Also, I didn't use the `Url` very nice API because it's not available in any IE version (sadness...).
cc `````@lzutao`````
r? `````@Nemo157`````
|
|
results and overall
|
|
|
|
|
|
Remove inline script tags
Fixes #81133.
cc ``@pietroalbini``
r? ``@Nemo157``
|
|
r=Nemo157,pickfire
Improve search result tab handling
Fixes #80378.
If the current search result tab is empty, it picks the first non-empty one. If all are empty, the current one doesn't change. It can be tested with "-> string" (where only the "returned elements" tab is not empty).
r? `@jyn514`
|
|
|
|
Improve JS performance by storing length before comparing to it in loops
Since https://github.com/rust-lang/rust/pull/79052 is quite complicated to review, I suggested to split into smaller parts. This first part is mostly about saving the array length into a variable (I tried to not change anything else as much as possible :smiley: ).
r? `@jyn514`
|
|
|
|
|
|
Remove bottom margin from crate version when the docs sidebar is collapsed
This fixes a mobile UI bug where a vertical scrollbar would always be
rendered on the sidebar nav when the menu was closed. When opened, the overflow would be handled by the opened sidebar, causing the scrollbar to disappear, and the contents to shift to the right.
## Firefox
**Before**


**After**


## Chrome
**Before**

**After**

|
|
This fixes a mobile UI bug where a vertical scrollbar would always be
rendered on the sidebar nav when the menu was closed.
|
|
More js cleanup
Part of #79052 (Same kind as #80515).
This one is about some small fixes:
* Replacing some loops with `onEachLazy`.
* Removing unused function arguments.
* Turn `buildHelperPopup` into a variable so it can be "replaced" once the function has been called once so it's not called again.
r? `@jyn514`
|
|
|
|
|
|
Fix search section position on small devices
Fixes #79526.
This is exactly the same issue fixed in 9c36491538476dd3ff5ec834944aacdaceb12f30 (in https://github.com/rust-lang/rust/pull/79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input.
r? `@jyn514`
|
|
Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
|
|
If all are empty, the current one doesn't change.
|
|
Use sans-serif font for the "all items" page links
The "all items" pages' links aren't using a sans-serif font unlike the rest of equivalent items in the other module pages. ``@Nemo157`` reported me this issue so here is the fix!
r? ``@Nemo157``
|
|
|
|
|
|
r=Nemo157
Move tooltips messages out of html
First thing first: nothing in the output has changed. You still have the "i" on the left of code blocks examples when they have `ignore`, `compile_fail`, `should_panic` and `edition`. The behavior also remains the same: when you hover the "i", you have the corresponding message showing up.
So now, why this PR then? I realized recently that we were actually generating those messages into the HTML every time whereas all messages are the same (except for the edition ones, I'll come back to it later). So instead of generating more content, I simply moved it inside the CSS thanks to pseudo elements (`::before` and `::after`). The message is now inside `::after` and we use the `::before` to have the small triangle on the left of the message. So now, we have less HTML generated which is seems pretty nice.
So now, back to the `edition` change: the message is globally the same, but the "edition" itself can be different (2015 or 2018 currently, I expect 2021 to arrive not too far in the future). So the only difference for it is that I added a new attribute on the tooltip called `edition` which contains this information. Then, the `::after` uses it inside its `content` (you can get the content of an element's attribute by using `attr` and concat different strings by simply having them after the other).
Don't hesitate if a part of my explanations isn't clear.
r? `@jyn514`
|
|
|
|
GuillaumeGomez:hide-associated-const-when-collapsing, r=jyn514
Hide associated constants too when collapsing implementation
Fixes #71849.
r? `@jyn514`
|
|
Show hidden elements by default when JS is disabled
Fixes #79301.
A lot of things are hidden by default which shouldn't when JS is disabled. This PR fixes it.
Before:

After:

r? `@jyn514`
|
|
Fix item name display on mobile
Fixes https://github.com/rust-lang/docs.rs/issues/1200


cc `@jyn514`
r? `@Nemo157`
|
|
The background was dark before, which made the text impossible to read.
Now the background is white, which is how selected `div`s are rendered.
As a result, the search results tabs now look identical to how they
used to look (before #79896).
|
|
|
|
|
|
|
|
Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs
Fixes https://github.com/rust-lang/rust/issues/65212
What took the longest time was to update the help popup in the end.
r? `@Manishearth`
|
|
search result tabs
|
|
|
|
|
|
@GuillaumeGomez was concerned about browser compatibility.
|
|
Previously Markdown documentation was not rendered to HTML for search results,
which led to the output not being very readable, particularly for inline code.
This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark
(the library rustdoc uses to parse Markdown for the main text of documentation).
However, the text for the title attribute (the text shown when you hover over an
element) still uses the plain-text rendering since it is displayed in browsers
as plain-text.
Only these styles will be rendered; everything else is stripped away:
* *italics*
* **bold**
* `inline code`
|
|
Make keyboard interactions in the settings menu more pleasant
#78868 improved the keyboard interactions with the settings page. This PR goes a bit further by allowing more than just "space" to toggle the checkboxes.
r? `@jyn514`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
through DOM iterators
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #78916 (extend const generics test suite)
- #78921 (Improve the page title switch handling between search and doc)
- #78933 (Don't print thread ids and names in `tracing` logs)
- #78960 (Test default values for const parameters.)
- #78971 (Update books)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Improve the page title switch handling between search and doc
The current behavior often "forgets" to update the page title when discarding/putting back the search results. This isn't optimal which is why I wrote this fix.
r? ``@jyn514``
|
|
Add shortcut for theme picker menu
Follow-up of #78584
Just like you can focus the search input by pressing "S", you can now access the theme picker menu by pressing "T" and navigate through the options only using the keyboard.
cc `@notriddle`
r? `@jyn514`
|
|
|
|
Setting a checkbox to `display:none` makes it impossible to tab onto it,
which makes the rustdoc settings page completely keyboard inaccessible.
|