The cargo
command line tool allows me to generate documentation for my crate, but I have structures like:
#[cfg(target-platform("windows")]
mod winstuff {
/// Explanation of Windows-specific tasks
}
#[cfg(target-platfrom("linux")]
mod linstuff {
/// Explanation of Linux-specific tasks
}
When I run cargo docs --no-deps
, only the platform-specific module I'm generating documentation for gets generated. How can I generate documentation for all platforms?
cargo-generate is a developer tool to help you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.
Cargo stores the output of a build into the "target" directory. By default, this is the directory named target in the root of your workspace.
All binaries installed with cargo install are stored in the installation root's bin folder. If you installed Rust using rustup.rs and don't have any custom configurations, this directory will be $HOME/. cargo/bin. Ensure that directory is in your $PATH to be able to run programs you've installed with cargo install .
When no target selection options are given, cargo doc will document all binary and library targets of the selected package. The binary will be skipped if its name is the same as the lib target. Binaries are skipped if they have required-features that are missing.
This is a known bug, there is no current fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With