-
Notifications
You must be signed in to change notification settings - Fork 13k
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
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
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 20, 2024
jieyouxu
added
the
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
label
Sep 20, 2024
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
Nice idea - maybe something for @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
The idea sounds nice. Will need to talk about it with the rest of the team. |
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. |
Implementation done. Cleaning up and then time to open the PR. |
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 6, 2024
Rollup merge of rust-lang#132155 - GuillaumeGomez:impl-block-doc, r=rustdoc Always display first line of impl blocks even when collapsed Fixes rust-lang#130612. It the line is too long, only the beginning will be visible: ![Screenshot from 2024-10-25 17-21-41](https://github.com/user-attachments/assets/dd2d912c-ad55-4410-8195-1d66a0a99ad4) Otherwise, it looks like this: ![image](https://github.com/user-attachments/assets/1f40b9e0-2143-4b9d-a4b0-338a0cd740df) Can be tested [here](https://rustdoc.crud.net/imperio/impl-block-doc/foo/struct.ImplDoc.html). r? `@notriddle`
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.
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.htmlHowever, if we collapse all the impl blocks, the documentation becomes much harder to overview.
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:
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.
The text was updated successfully, but these errors were encountered: