cargo doc: add option to document only public items for binary crates
Nobody has claimed this yet.
- 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-itemsflag 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
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 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