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: First line of documentation on collapsed impl blocks should be visible #130612

Open
crumblingstatue opened this issue Sep 20, 2024 · 4 comments · May be fixed by #132155
Open

rustdoc: First line of documentation on collapsed impl blocks should be visible #130612

crumblingstatue opened this issue Sep 20, 2024 · 4 comments · May be fixed by #132155
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@crumblingstatue
Copy link
Contributor

There exists a technique to make a type's methods more organized, by putting them in separate impl blocks.
This also helps with the organization of the documentation. Makes the various methods much easier to overview and discover.
For an example, take a look at what egui is doing with its Ui type: https://docs.rs/egui/latest/egui/struct.Ui.html
Image

However, if we collapse all the impl blocks, the documentation becomes much harder to overview.

Image

Rustdoc could help the user out here by displaying the first line of the documentation for each collapsed impl block.

Concept art cobbled together in GIMP:
Image

Moreover, there should be an easy way to collapse all impl blocks for easy overview.
Currently, all impl blocks have to be collapsed manually one-by-one. The "collapse all docs" button ignores impl blocks.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 20, 2024
@jieyouxu jieyouxu added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 20, 2024
@saethlin saethlin added A-rustdoc-ui Area: Rustdoc UI (generated HTML) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 21, 2024
@emilk
Copy link

emilk commented Sep 25, 2024

Nice idea - maybe something for @GuillaumeGomez? :)

@GuillaumeGomez GuillaumeGomez added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Sep 25, 2024
@GuillaumeGomez
Copy link
Member

The idea sounds nice. Will need to talk about it with the rest of the team.

@GuillaumeGomez
Copy link
Member

We just discussed it in rustdoc meeting and all present members agreed that it was a good idea. We will (hopefully I will have some time next week) try to implement it in the near future.

@GuillaumeGomez
Copy link
Member

Implementation done. Cleaning up and then time to open the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants