crates/but-clap/README.md
This is our documentation generation library. It uses the Clap derive documentation that is how we generate our help messages to create our man page like documentation as well.
Running this command:
cargo run -p but-clap --features raw-clap-docs
will create a new directory called cli-docs that is Git-ignored and populates
it with one mdx file for each command.
The raw-clap-docs feature is required for website docs generation. It keeps
Clap doc comments as raw Markdown for MDX output. Normal CLI builds should not
enable it, so but --help uses Clap's formatted help output.
We use the long-about docstrings to do everything. It can take markdown (we use
the unstable-markdown feature in clap to parse correctly) and has some special
sections that are pulled out.
The but-clap crate includes comprehensive tests to ensure that clap-documented Rust files generate correct MDX documentation.
cargo test -p but-clap
The tests cover various command structures:
but command to ensure compatibility