Description
Problem
I believe it may be useful to add a flag or functionality to choose what crate cargo doc --open
opens to. For repositories with a lot of local crates, this could be useful for newcomers who want to know where to start.
A current workaround is to generate docs for all crates and then package the specific crate you want.
cargo doc --all
cargo doc -p <desired-crate> --open
However, that workaround requires circumstantial knowledge of cargo doc
. Perhaps, the spirit of what this is trying to accomplish can be achieved in one cargo doc
command.
Proposed Solution
I haven't dug too deep into the cargo doc
codebase yet, but generally, the solution could look like the following:
cargo doc --open-at-crate <desired-crate>
Alternatively or additionally, users could specify a "default docs crate" that cargo doc --open
opens to.
[package]
default_doc_crate = "<desired-crate>"
Notes
This functionality might already exist and I could be missing something! Thanks for reading and for all contributors to cargo
.
Similar issue: #3805
For opening to a specific mod, see #10516