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: Please use sticky headers for impl blocks #133506

Open
joshtriplett opened this issue Nov 26, 2024 · 3 comments · May be fixed by #133717
Open

rustdoc: Please use sticky headers for impl blocks #133506

joshtriplett opened this issue Nov 26, 2024 · 3 comments · May be fixed by #133717
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@joshtriplett
Copy link
Member

joshtriplett commented Nov 26, 2024

If you have a long rustdoc page with different impl blocks for the same type, such as https://doc.rust-lang.org/1.82.0/std/primitive.slice.html , each of which has various methods, it's really easy to lose track of which impl block a method is in.

I'd love to see rustdoc use "sticky" headings for impl blocks, which stay visible while scrolling through the contents of the impl block, and scroll away when past that impl block. This should be possible with a bit of CSS (no JavaScript required).

This came up when discussing some methods we wanted to add to [MaybeUninit<T>].

@joshtriplett joshtriplett added 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. labels Nov 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 26, 2024
@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 26, 2024
@RalfJung
Copy link
Member

RalfJung commented Dec 1, 2024

Oh yes that would be amazing. Currently it can actually be quite hard to figure out what the type of self is when looking at a method in rustdoc.

Cc @rust-lang/rustdoc

@GuillaumeGomez
Copy link
Member

It's a very good idea. Gonna add that.

@GuillaumeGomez GuillaumeGomez linked a pull request Dec 1, 2024 that will close this issue
@GuillaumeGomez
Copy link
Member

Opened #133717.

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) C-enhancement Category: An issue proposing an enhancement or a PR with one. 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
@joshtriplett @RalfJung @GuillaumeGomez @jieyouxu @rustbot and others