-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo doc
only direct dependencies
#2025
Comments
This seems to hit the "Shared vs. Internal Dependencies" weakness pointed out in a wildcard dependencies RFC comment. Do you perhaps want to hide the crates that are just implementation details, no matter whose dependencies they are? |
Yea that is even more ideal, in general is expect the docs generated to be "relevant" to a user of the crate. So internal crates can be ignored as well. |
Maybe it would be even enough to just hide external dependencies from the side bar to remove visual and cognitive clutter? |
My expectation (as a relatively new rust/cargo user) when running Just for context... |
I tried the workaround, but it looks like |
A workaround for documenting direct dependencies: cargo tree --depth 1 -e normal --prefix none | cut -d' ' -f1 | xargs printf -- '-p %s\n' | xargs cargo doc --no-deps
# become `cargo doc --no-deps -p <crate1> -p <crate2> -p <crate2>…` Labelled as |
It would be very useful if I could use a flag to do this instead of a workaround. |
What I'd like is for the crates in my workspace to have docs generated for them, and for any other deps that are not in my workspace to be emitted with links to crates.io (assuming that rustdoc knows that the deps are hosted in that registry) as well as the main rust docs for the built-in types. I don't believe that there is a solution for this currently; I'm open to hearing about workarounds that can achieve this! EDIT: Oh, I can use |
I believe this can be done with https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#rustdoc-map which can be configured to link to |
As part of or after we get #6129, should we switch the behavior to document all of the public dependencies? |
`#[cfg(doc)]` could change the interface and thus fail the build. Refs: * rust-lang/cargo#8811 * rust-lang/cargo#2025 changelog: changed
From #1529 I suggested the following
All this is to say, generate docs for dependencies in Cargo.toml, but not Cargo.lock.
The text was updated successfully, but these errors were encountered: