1 unstable release

0.1.0 Feb 22, 2019

#2964 in Procedural macros

Download history 26/week @ 2024-12-26 72/week @ 2025-01-02 75/week @ 2025-01-09 82/week @ 2025-01-16 60/week @ 2025-01-23 197/week @ 2025-01-30 146/week @ 2025-02-06 137/week @ 2025-02-13 137/week @ 2025-02-20 95/week @ 2025-02-27 201/week @ 2025-03-06 107/week @ 2025-03-13 100/week @ 2025-03-20 140/week @ 2025-03-27 237/week @ 2025-04-03 120/week @ 2025-04-10

609 downloads per month
Used in 10 crates (4 directly)

MIT license

14KB
220 lines

doc-cfg

travis-badge release-badge docs-badge license-badge

The #[doc_cfg(..)] attribute is a convenience that removes the boilerplate involved with using #[doc(cfg(..))] in stable crates.

Usage

Add the following to Cargo.toml to get started:

[dependencies]
doc-cfg = { version = "0.1" }

[features]
unstable-doc-cfg = []

[package.metadata.docs.rs]
features = ["unstable-doc-cfg"]

In your crate, use #[doc_cfg(..)] where you'd normally use #[cfg(..)]:

#![cfg_attr(feature = "unstable-doc-cfg", feature(doc_cfg))]

use doc_cfg::doc_cfg;

#[doc_cfg(windows)]
pub fn cool_nonportable_fn() { }

The name of the feature is important and should not be changed. Check out the full example for how to use it. The unstable-doc-cfg feature should only be turned on when documenting, #[doc_cfg(..)] is otherwise identical to #[cfg(..)] when built without it.

Documentation

See the documentation and example for up to date usage information.

Dependencies

~320KB