#cargo-toml #documentation #features #macro #rustdoc

macro document-features

Extract documentation for the feature flags from comments in Cargo.toml

10 releases

0.2.8 Dec 29, 2023
0.2.7 Dec 21, 2022
0.2.6 Sep 24, 2022
0.2.3 Aug 15, 2022
0.1.0 Feb 1, 2022

#167 in Development tools

Download history 8072/week @ 2023-12-24 13640/week @ 2023-12-31 20038/week @ 2024-01-07 20209/week @ 2024-01-14 23048/week @ 2024-01-21 19229/week @ 2024-01-28 24971/week @ 2024-02-04 27126/week @ 2024-02-11 27797/week @ 2024-02-18 34361/week @ 2024-02-25 37254/week @ 2024-03-03 40914/week @ 2024-03-10 39670/week @ 2024-03-17 40135/week @ 2024-03-24 40924/week @ 2024-03-31 30107/week @ 2024-04-07

153,868 downloads per month
Used in 456 crates (217 directly)

MIT/Apache

30KB
698 lines

Document your crate's feature flags

Crates.io Documentation

This crate provides a macro that extracts documentation comments from Cargo.toml

To use this crate, add #![doc = document_features::document_features!()] in your crate documentation. The document_features!() macro reads your Cargo.toml file, extracts feature comments and generates a markdown string for your documentation.

Use ## and #! comments in your Cargo.toml to document features, for example:

[dependencies]
document-features = "0.2"
## ...

[features]
## The foo feature enables the `foo` functions
foo = []
## The bar feature enables the [`bar`] module
bar = []

#! ### Experimental features
#! The following features are experimental

## Activate the fusion reactor
fusion = []

These comments keep the feature definition and documentation next to each other, and they are then rendered into your crate documentation.

Check out the documentation for more details.

Contributions

Contributions are welcome. We accept pull requests and bug reports.

License

MIT OR Apache-2.0

Dependencies

~175KB