rust-lang / rust-lang/rust

rustdoc: Please use sticky headers for impl blocks

Open
#133,506 3 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-rustdoc-ui C-enhancement T-rustdoc T-rustdoc-frontend
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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>].

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the rustdoc page structure for impl-block headings and the CSS used by generated documentation, using the linked slice documentation page as a reference. Confirm that impl headings remain visible while scrolling within their block and scroll away after the block ends, without JavaScript.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.