rust-lang / rust-lang/cargo

cargo doc: add option to document only public items for binary crates

Open
#7,963 4 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request Command-doc S-needs-mentor
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Describe the problem you are trying to solve

https://github.com/rust-lang/cargo/pull/7593 enables --document-private-items flag by default for binary crates. As stated in the PR:

We should also probably add a --document-only-public-items flag or something like that if we change the default behavior. Otherwise users have no way to not document private items for binary crates. Right? -> We can do it later

Describe the solution you'd like

Add flag like --document-only-public-items which can be used for binary crates to disable flag --document-private-items (which is enabled by default)

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 at cargo doc's handling of --document-private-items and review the binary-crate default behavior introduced by pull request 7593. Define how a --document-only-public-items option should override that default for binary crates, then verify that cargo doc produces only public items when the option is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.