Open nvzqz opened 4 years ago
Hey there, I just found this issue and thought I'd point you to something similar that I did for the Lucky project.
There is a Cargo feature flag used to build the CLI as a doc generator that will pull the CLI information and generate mdbook pages: https://katharostech.github.io/lucky/cli/lucky.html. That is then run in CI before publishing the book to GitHub pages.
This may be far departed from what you are going for. Because Lucky has a rather vast and nested CLI I developed a custom command trait to wrap each subcommand and a system for associating the markdown documentation with the subcommands. The documentation can also be rendered in the terminal:
Anyway, just throwing this out there if you are interested in anything similar. :)
Possible CLI commands should be available to read in
.md
files.It may be possible to generate markdown for commands with information passed into
clap
. Or at least when that info is being passed toclap
.