| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with `defer`, meaning it is often run after the document is rendered.
Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.
Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.
|
|
Now that the "All Crates" dropdown is only rendered on the search results page,
there is no need to load crates.js on most pages. Load it only on crate pages.
Also, add the `defer` attribute so it does not block page rendering.
For sidebar-items.js, move the script tag to `<head>`. Since it already has the
defer attribute it won't block loading. The defer attribute does preserve
ordering between scripts, so instead of the callback on load, it can set a
global variable on load, which is slightly simpler. Also, since it is required
to finish rendering the page, beginning its load earlier is better.
Remove generation and handling of sidebar-vars. Everything there can be computed
with information available in JS via other means.
Remove the "other" wrapper in the sidebar. It was unnecessary.
Remove excess script fields
|
|
|
|
|
|
|
|
Improve settings theme display
This is a follow-up of #96958. In this PR, I changed how the theme radio buttons are displayed and improved their look as well.
It now looks like this:


You can test it [here](https://rustdoc.crud.net/imperio/improve-settings-theme-display/doc/foo/index.html).
r? `@jsha`
|
|
line number
|
|
|
|
|
|
Add more eslint rules
This PR adds more eslint rules. Here are the explanations for each of them:
* [space-infix-ops](https://eslint.org/docs/rules/space-infix-ops)
* [space-before-function-paren](https://eslint.org/docs/rules/space-before-function-paren)
* [space-before-blocks](https://eslint.org/docs/rules/space-before-blocks)
* [comma-dangle](https://eslint.org/docs/rules/comma-dangle)
* [comma-style](https://eslint.org/docs/rules/comma-style)
* [max-len](https://eslint.org/docs/rules/max-len)
* [eol-last](https://eslint.org/docs/rules/eol-last)
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
Search GUI fixes
The first fix is about the duplicated "in":

The second fix is about the `<select>` broken style:


You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test).
r? `@notriddle`
|
|
Previously, search.js relied on the DOM and the `window` object. It can now be
loaded in the absence of the DOM, for instance by Node. The same is true of
search-index.js.
This allows removing a lot of code from src/tools/rustdoc-js/tester.js that
tried to parse search.js and extract specific functions that were needed for
testing.
|
|
|
|
|
|
|
|
|
|
|
|
Fix js error
On the source code pages, we get a JS error:

It's fixed in the first commit. The second one is removing an unused CSS rule and the third one is a little cleanup of a GUI test.
cc ``@jsha``
r? ``@notriddle``
|
|
rustdoc: search result ranking fix
# Before

# After

|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: ensure HTML/JS side implementors don't have dups
Fixes #94641
Rendered:
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/std/iter/trait.Iterator.html
- https://notriddle.com/notriddle-rustdoc-test/impl-dups/core/iter/trait.Iterator.html
|
|
Fixes reexports in search
Fixes #96681.
At some point we stopped reexporting items in search so this PR fixes it.
It also adds a regression test.
r? ```@notriddle```
|
|
r=GuillaumeGomez,jsha
rustdoc: when running a function-signature search, tweak the tab bar
# Before

# After

|
|
|
|
r=jsha
Improve settings loading strategy
I learned about this thanks to ```@jsha``` who suggested this approach:
It improves the settings loading strategy by loading CSS and JS at the same time to prevent the style to be applied afterwards on slow connections.
r? ```@jsha```
|
|
Add rotation animation on settings button when loading
As discussed, I added an animation when the settings JS file is loading (I voluntarily made the timeout at the end of the `settings.js` super long so we can see what the animation looks like):
https://user-images.githubusercontent.com/3050060/166693243-816a08b7-5e39-4142-acd3-686ad9950d8e.mp4
r? ````@jsha````
|
|
|
|
prevent the style to be applied afterwards on slow connections
|
|
|
|
|
|
* If it's just `-> a`, use "In Function Return Types"
* If it's just `a b`, use "In Function Parameters"
* Otherwise, still use "In Function Signatures"
|
|
|
|
|
|
|
|
Fix lint
Fix main.js
Restore anonymous functions
Fix
Fix more
|
|
* Improve code.
* Fix some documentation argument types.
* Make settings order the same as before this PR.
* Change timeout to 0 so that browser will render it as fast as possible.
|
|
|
|
Switch JS code to ES6 - part 2
Part of #93058.
It's based on https://github.com/rust-lang/rust/pull/96361 so it needs to wait for it to be merged first.
r? `@notriddle`
|
|
|
|
|