| Age | Commit message (Collapse) | Author | Lines |
|
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.
|
|
- 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.
|
|
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
|
|
|
|
This reduces clutter on doc pages.
|
|
This follows the Closure Compiler dialect of JSDoc, so we
can use it to do some basic type checking. We don't plan to
compile with Closure Compiler, just use it to check types. See
https://github.com/google/closure-compiler/wiki/ for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We had been injecting the list of themes and the rustdoc version into
main.js by rewriting it at doc generation time. By avoiding this
rewrite, we can make it easier to edit main.js without regenerating all
the docs.
Added a more convenient accessor for rustdoc-vars.
Changed storage.js to not rely on resourcesSuffix. It could in theory
use rustdoc-vars, but because rustdoc-vars is at the end of the HTML,
it's not available when storage.js runs (very early in page load).
|
|
|
|
|
|
A byproduct of using `<details>` and `<summary>` to show/hide detailed
documentation was that clicking any part of a method heading (or impl
heading) would show or hide the documentation. This was not super
noticeable because clicking a link inside the method heading would
navigate to that link. But clicking any unlinked black text in a method
heading would trigger the behavior.
That behavior was somewhat unexpected, and means that if you try to click
a type name in a method heading, but miss by a few pixels, you get a
confusing surprise.
This change inhibits that behavior by putting an event listener on most
summaries that cancels the event unless the event target was the summary
itself. In practice, that means it cancels the event unless the target
was the "[+]" / "[-]", because the rest of the heading is wrapped inside
a `<div>`, which is the target for anything that doesn't have a more
specific target.
|
|
|
|
Also, remove the highlighting of the search bar in disabled state. This
reduces flicker when loading a page.
|
|
|
|
Fix failing test
Add missing backslash
Fix padding issue with horizontal scrollbar
|
|
remove ID from line numbers, fix horizontal scrolling on non-expanded elements
|
|
|
|
|
|
* Move call location logic from function constructor to rendering
* Fix issue with macro spans in scraping examples
* Clean up example loading logic
Documentation / newtype for DecorationInfo
Fix line number display
Serialize edition of call site, other small cleanup
|
|
Continue migrating JS functionality
Cleanup
Fix compile error
Clean up the diff
Set toggle font to sans-serif
|
|
Improve styling
Start to clean up code, add comments
|
|
Simplify toggle UI logic, add workspace root for URLs
|
|
Clean up tidy checks
|
|
Move rendering of examples into
Finalize design
Cleanup, rename found -> scraped
Softer yellow
Clean up dead code
Document scrape_examples
More simplification and documentation
Remove extra css
Test
|
|
|
|
|
|
[rustdoc] Copy only item path to clipboard rather than full `use` statement.
The (somewhat) recent addition of the "copy item import to clipboard" button is extremely nice.
However, i tend to write my code with fully qualified paths wherever feasible and only resort to `use` statements as a refactoring pass. This makes the "copy to clipboard" workflow awkward to use, as i would be copy-pasting that as, say
```rust
impl use std::ops::Add; for MyType {
```
and then go back and remove the `use ` and `;`.
This PR removes the `use ;` decorations, making it much nicer to use for fully-qualified items. I argue, however, that this does not noticeably degrade experience for those who prefer to import items, since the hard part about those is getting the path right, and writing the `use ;` decoration can be done by hand with little effort.
|
|
Part of #87059
Partially reverts #84703
Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
|
|
In #86157
cd0f93193c84ddc6698f9b65909da71c084dcb74
Use Tera templates for rustdoc.
dropped the following transformation from the keys of the default
settings element's `data-` attribute names:
.map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v)))
The `Escape` part is indeed no longer needed, because Tera does that
for us. But the massaging of `-` to `_` is needed, for the (bizarre)
reasons explained in the new comments.
I have tested that the default theme function works again for me. I
have also verified that passing
--default-theme="zork&"
escapes the value in the HTML.
Closes #87263.
CC: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
Fix implementors display
Part of https://github.com/rust-lang/rust/issues/86632.
This PR does a few things:
* It fixes of the JS rendered implementors.
* It generates anchors for JS rendered implementors to make it coherent with the others.
* It adds a test to ensure that we won't have the same issue again.
* It changes the way we render the rustdoc-gui crates to simplify it a bit and also to allow to have dependencies without going through compiletest.
Before:

After:

I plan to add the `[src]` links in another PR because this one is already big enough.
cc `@Mark-Simulacrum` (for the bootstrap changes)
r? `@Nemo157`
|
|
This function was used in an earlier version, when idx's were used
to serialize function inputs and outputs. That's not done any more,
so removed the JS-side support for it.
|
|
|
|
|