-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: add ways of collapsing all impl blocks #141663
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
base: master
Are you sure you want to change the base?
rustdoc: add ways of collapsing all impl blocks #141663
Conversation
either shift+click the Summary button, or use the `_` key. this collapses everything, including (inherent) impl blocks. no need for a special "expand all impl blocks" method, as impl blocks are expanded during regular "expand all". doing "expand all" -> "collapse all" will always result in only impl blocks being expaned.
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
done a bit awkwardly to try to avoid introducing new whitespaces nodes, which could affect display
I'm neutral about this. I don't see the need but I suppose if someone opened the issue, there is one... cc @rust-lang/rustdoc-frontend |
It's a small improvement, but I think it is helpful, especially for internal docs. For example, if I had this, I might not have made the mistake of initially adding |
It wouldn't be hard to test the Anyway, 👍 this feature. |
collapseAllDocs(); | ||
collapseAllDocs(false); | ||
break; | ||
case "_": |
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.
I don't think adding a new key to handle it is a good idea. What you suggested with shift+minus sounds like a better approach.
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.
doesn't shift + minus send _
on a standard US keyboard? or is there something I don't know about JS events?
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 does, yes. getVirtualKey uses event.key, which sends the printable representation of the text.
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.
I don't have opinion on the feature, however I think we should definitely talk about the new key binding (_
).
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
I think it's also worth asking if we should make a way of doing this on mobile, but i don't see an easy way, it seems like we would have to manually implement a double tap delay or something similar. |
either shift+click the Summary button,
or use the
_
key.this collapses everything,
including (inherent) impl blocks.
no need for a special "expand all impl blocks"
method, as impl blocks are expanded during regular "expand all".
doing "expand all" -> "collapse all" will always
result in only impl blocks being expaned.
not sure the best way to add a GUI test.
fixes #134429