-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use details tag for trait implementors. #84320
Conversation
Some changes occurred in HTML/CSS/JS. |
r? @jyn514 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
How does this interact with #82805 ? Should we merge that first? |
This is independent of #82805, since we use a class name ( BTW I'm seeing errors in the rustdoc tests about xpaths not matching. Is there a command I can use to run just the rustdoc tests? |
Yes, |
@jsha also consider setting |
This comment has been minimized.
This comment has been minimized.
Would it be possible to somehow bring back the "clickable" mouse icon state when hovering, at least over the toggle, or maybe show a tiny grey highlight over the entire "clickable" line to hint the user that it's interactive? (Thanks for all the work on simplifying HTML/JS parts of rustdoc!) |
Yep! Thanks for noticing. I thought I had done that already, but you're right that it's not in this PR. |
711fae9
to
c26d640
Compare
Alright, pushed a new version with tests fixed and the cursor made into a pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, we should make sure the rendered version works on other platforms too
Just remains to fix @Nemo157's issue and I guess we're good to go? |
c26d640
to
9716b1d
Compare
This switches from JS-generated toggles to using the HTML <details> tag for expanding and collapsing entries in the "Implementors" section.
9716b1d
to
569096c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to r=me this if Nemo's issue has been fixed
Waiting for @Nemo157's confirmation then. :) |
Yep, it's fixed in the current version. |
💥 Test timed out |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
⌛ Testing commit 569096c with merge 925cab99c4e0eb12370602bb567e962bc58c0895... |
💥 Test timed out |
Really weird... @bors retry |
#82805 does affect this, at least on Firefox, injecting but since this is probably merging first, I guess it can be fixed there. |
…earth,Nemo157,GuillaumeGomez Use details tag for trait implementors. Part of rust-lang#83332 and following on from rust-lang#83337 and rust-lang#83355. This removes one category of JS-generated toggles (implementors), and replaces them with a `<details>` tag. This simplifies the JS, and fixes some bugs where things that were supposed to be hidden by the toggle were not hidden. Compare https://hoffman-andrews.com/rust/details-implementors/std/io/trait.Read.html#impl-Read vs https://doc.rust-lang.org/nightly/std/io/trait.Read.html#implementors. This introduces a `left: -23px` to put the toggle in the correct place, matching the current style for `.collapse-toggle`. It's worth noting this introduces a slight behavior change: since the entire line is now a `<summary>`, any part of the line is clickable. So for instance, in `impl Read for File`, clicking `impl` or `for` will collapse / expand the docs. Clicking `Read` or `File` still links to the appropriate documentation as before.
…earth,Nemo157,GuillaumeGomez Use details tag for trait implementors. Part of rust-lang#83332 and following on from rust-lang#83337 and rust-lang#83355. This removes one category of JS-generated toggles (implementors), and replaces them with a `<details>` tag. This simplifies the JS, and fixes some bugs where things that were supposed to be hidden by the toggle were not hidden. Compare https://hoffman-andrews.com/rust/details-implementors/std/io/trait.Read.html#impl-Read vs https://doc.rust-lang.org/nightly/std/io/trait.Read.html#implementors. This introduces a `left: -23px` to put the toggle in the correct place, matching the current style for `.collapse-toggle`. It's worth noting this introduces a slight behavior change: since the entire line is now a `<summary>`, any part of the line is clickable. So for instance, in `impl Read for File`, clicking `impl` or `for` will collapse / expand the docs. Clicking `Read` or `File` still links to the appropriate documentation as before.
Rollup of 10 pull requests Successful merges: - rust-lang#83990 (implement `TrustedRandomAccess` for `Take` iterator adapter) - rust-lang#84250 (bootstrap: use bash on illumos to run install scripts) - rust-lang#84320 (Use details tag for trait implementors.) - rust-lang#84436 (Make a few functions private) - rust-lang#84453 (Document From implementations for Waker and RawWaker) - rust-lang#84458 (Remove unnecessary fields and parameters in rustdoc) - rust-lang#84485 (Add some associated type bounds tests) - rust-lang#84489 (Mention FusedIterator case in Iterator::fuse doc) - rust-lang#84492 (rustdoc: Remove unnecessary dummy span) - rust-lang#84496 (Add some specialization tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…g, r=jsha Clean up DOM strings Follow-up of rust-lang#84320. r? `@jsha`
…g, r=jsha Clean up DOM strings Follow-up of rust-lang#84320. r? ``@jsha``
Part of #83332 and following on from #83337 and #83355.
This removes one category of JS-generated toggles (implementors), and replaces them with a
<details>
tag. This simplifies the JS, and fixes some bugs where things that were supposed to be hidden by the toggle were not hidden. Compare https://hoffman-andrews.com/rust/details-implementors/std/io/trait.Read.html#impl-Read vs https://doc.rust-lang.org/nightly/std/io/trait.Read.html#implementors.This introduces a
left: -23px
to put the toggle in the correct place, matching the current style for.collapse-toggle
.It's worth noting this introduces a slight behavior change: since the entire line is now a
<summary>
, any part of the line is clickable. So for instance, inimpl Read for File
, clickingimpl
orfor
will collapse / expand the docs. ClickingRead
orFile
still links to the appropriate documentation as before.