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

macro document-features

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

11 releases

0.2.10 Jul 12, 2024
0.2.8 Dec 29, 2023
0.2.7 Dec 21, 2022
0.2.6 Sep 24, 2022
0.2.1 Feb 12, 2022

#114 in Development tools

Download history 94188/week @ 2024-07-22 133565/week @ 2024-07-29 130497/week @ 2024-08-05 166823/week @ 2024-08-12 191853/week @ 2024-08-19 121974/week @ 2024-08-26 128816/week @ 2024-09-02 125489/week @ 2024-09-09 142704/week @ 2024-09-16 154588/week @ 2024-09-23 156905/week @ 2024-09-30 171467/week @ 2024-10-07 163073/week @ 2024-10-14 169328/week @ 2024-10-21 171261/week @ 2024-10-28 195039/week @ 2024-11-04

709,788 downloads per month
Used in 1,637 crates (296 directly)

MIT/Apache

33KB
765 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

~170KB