#documentation #features #rustdoc #macro

macro document-features

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

3 unstable releases

0.2.1 Feb 12, 2022
0.2.0 Feb 11, 2022
0.1.0 Feb 1, 2022

#361 in Development tools

Download history 432/week @ 2022-03-11 368/week @ 2022-03-18 386/week @ 2022-03-25 622/week @ 2022-04-01 656/week @ 2022-04-08 687/week @ 2022-04-15 553/week @ 2022-04-22 610/week @ 2022-04-29 668/week @ 2022-05-06 758/week @ 2022-05-13 697/week @ 2022-05-20 533/week @ 2022-05-27 640/week @ 2022-06-03 614/week @ 2022-06-10 634/week @ 2022-06-17 456/week @ 2022-06-24

2,414 downloads per month
Used in fewer than 26 crates

MIT/Apache

17KB
346 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.1"
## ...

[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

No runtime deps

Features

  • self-test