Skip to content
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

Rustdoc: collapse everything except impl Struct blocks #57582

Closed
ghost opened this issue Jan 13, 2019 · 3 comments
Closed

Rustdoc: collapse everything except impl Struct blocks #57582

ghost opened this issue Jan 13, 2019 · 3 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Jan 13, 2019

Most of the time when browsing docs I'd like to first have everything collapsed except the impl Struct blocks, skim over the available methods, and then dig in deeper if necessary.

Currently, we have the [+] button that either expands everything or collapses everything. It'd be nice to have something in between.

Twitter thread: https://twitter.com/stjepang/status/1084525502545698816
Seems like a lot of people would like to have the "all collapsed except impl Struct" view presented by default.

cc @GuillaumeGomez

@Centril Centril added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Jan 14, 2019
@GuillaumeGomez
Copy link
Member

It's also a decision to be taken by the @rust-lang/docs team. Personally I think it's a good idea.

@jonas-schievink
Copy link
Contributor

FWIW I also think it shouldn't collapse the item declaration by default (especially for traits and enums) since it's a decent and easy to parse overview

@BurntSushi
Copy link
Member

Yeah, if we're talking about defaults here, then I agree, we wouldn't want everything collapsed. The guiding principle there---at least IMO---is something like, "is it possible to get a high level overview of the API at a glance without having to scroll through reams of documentation?" Of course, my solution here (collapsing method docs) isn't the only answer to that, although it might be the simplest.

I will note that, at least intuitively, I would expect enabling the settings, "auto hide item attributes", "auto hide traits impl docs" and "auto hide item methods' docs" to be roughly what I want here. But I've never been able to get those settings to work reliably in a way that results in the screenshot I shared on twitter. So in that sense, this could also be considered a bug report. But I don't have a ton of context here, and honestly, my interpretation of the settings could be wrong! Nonetheless, if I could have achieved what I wanted through these settings, I wouldn't have written a script to do it for me. But I couldn't figure out how.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 7, 2019
…hing, r=QuietMisdreavus

Prevent automatic collapse of methods impl blocks

Fixes rust-lang#57582.

r? @QuietMisdreavus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants