Initial import of document-features-0.2.6 am: 555ca75099

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/document-features/+/2287897

Change-Id: I1f6f3c9d50c8039f955244a072a5f0e232726535
Signed-off-by: Automerger Merge Worker <[email protected]>
tree: 4f29ef0c0ff7d75f6180ff334e5d61e85c80847e
  1. .github/
  2. tests/
  3. .cargo_vcs_info.json
  4. .gitignore
  5. Cargo.toml
  6. Cargo.toml.orig
  7. CHANGELOG.md
  8. lib.rs
  9. LICENSE-APACHE
  10. LICENSE-MIT
  11. METADATA
  12. MODULE_LICENSE_APACHE2
  13. OWNERS
  14. README.md
  15. rustfmt.toml
README.md

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