#documentation #add #macro #facilitate #gated

macro docfg

Convenience macro to add documentation gated features

1 unstable release

0.1.0 Nov 23, 2022

#39 in #facilitate

Download history 45/week @ 2024-07-19 97/week @ 2024-07-26 38/week @ 2024-08-02 140/week @ 2024-08-09 27/week @ 2024-08-16 27/week @ 2024-08-23 45/week @ 2024-08-30 32/week @ 2024-09-06 32/week @ 2024-09-13 54/week @ 2024-09-20 32/week @ 2024-09-27 16/week @ 2024-10-04 23/week @ 2024-10-11 24/week @ 2024-10-18 19/week @ 2024-10-25 39/week @ 2024-11-01

106 downloads per month
Used in 9 crates (8 directly)

MIT license

3KB

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 () {
    // ...
}

Dependencies

~1.5MB
~37K SLoC