rust-lang / rust-lang/rust

Runtime toggle for private/hidden items documentation

Open
#149,106 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-intra-doc-links A-rust-for-linux A-rustdoc-ui T-rustdoc T-rustdoc-frontend
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In some projects, it can be useful to see private/hidden items/documentation/details (and /* private fields */ etc.) without having to go into the source view, which isn't as nice.

Instead of re-rendering the documentation with --document-private-items and --document-hidden-items, it would be very interesting to have a runtime toggle (i.e. in the web UI) that users could click to show hidden and/or private items on the fly.

This feature would also mean that we would already get checking for private/hidden items, i.e. it could be an alternative for https://github.com/rust-lang/rust/issues/149105 for those that want to use the runtime toggle anyway.

This can be worked around on the user side by generating every documentation set needed and then adding custom UI. Of course, that is slower, takes more space, doesn't allow for an implementation that avoids reloading, users need to reimplement the same idea, etc.

https://github.com/rust-lang/rust/pull/141299

Cc @GuillaumeGomez @fmease @lolbinarycat

@rustbot label T-rustdoc
@rustbot label A-intra-doc-links
@rustbot label A-rust-for-linux

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 reviewing the existing --document-private-items and --document-hidden-items behavior and the linked PR #141299. Then examine the rustdoc web UI approach described in the issue. Done means users can toggle private and hidden items at runtime without regenerating or reloading the documentation, while retaining the relevant checking behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.