docfg 0.1.0

Convenience macro to add documentation gated features
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 2.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 250.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Aandreba/docfg
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Aandreba

Crate thet facilitates the documentation of feature-gated code. This crate requires the use of the doc_cfg nightly feature.

Remember to add the following to your Cargo.toml file for the crate make efect when documenting on docs.rs

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

And when generating local documentation, use cargo rustdoc -- --cfg docsrs

Example

#[docfg(test)]
fn test () {
    // ...  
}
#[cfg_attr(docsrs, doc(cfg(test)))]
#[cfg(test)]
fn test () {
    // ...
}