rustdoc: sidebar generation code duplicates logic
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I recently discovered this in https://github.com/rust-lang/rust/pull/138574, when I fixed the bug for the main page, but the erroneous items were still in the sidebar.
If we simply collected a list of sidebar items during rendering of the main page, almost the entirety of sidebar.rs could be removed. This could even be done incrementally, with each sidebar_* function being replaced with a field on Context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sidebar.rs and trace the main-page rendering path described in the issue. Compare how sidebar items are produced with the proposed collection during main-page rendering, then identify a sidebar_* function that can be replaced by a Context field. Done means the duplicated sidebar logic is removed incrementally and the sidebar no longer retains the erroneous items described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100