clap-documentation
Automatically generate Markdown or AsciiDoc documentation for
clap command-line tools.
Examples
Generate Markdown text for a basic clap app:
let markdown: String = ;
Generate AsciiDoc text for a basic clap app:
let asciidoc: String = ;
Generated Examples:
See clap example programs and the corresponding documentation generated by
clap-documentation:
| Program | Markdown | AsciiDoc |
|---|---|---|
./complex_app.rs |
complex-app.md | complex-app.adoc |
Usage Convention
This section describes a suggested convention for using clap-documentation to
generate a CommandLineHelp.md or CommandLineHelp.adoc file, which can be
committed to source control and viewed as online documentation.
- Add hidden
--markdown-helpand/or--asciidoc-helpoptions to yourclapapplication:
use Parser;
- Invoke the option to generate a documentation file:
$ cargo run -- --markdown-help > docs/CommandLineHelp.md
$ cargo run -- --asciidoc-help > docs/CommandLineHelp.adoc
- Save the file in git, and link to it from the project's README.md or other relevant documentation.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See Development.md for instructions on how to perform common development tasks.