Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Generate CLI documentation automatically #3157

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

olivier-lacroix
Copy link
Contributor

Fixes #3022

This uses the clap-markdown crate to generate the CLI doc. As it stands, the documentation is on a single page, with no indentation for subcommands. Would you be happy to live with the default layout of clap-markdown?

Otherwise, we could either vendor the code or add more configuration options upstream.

Would need to happen next:

  • add missing information from the documentation to the doctstrings
  • add a CLI doc generation step to CI

#[derive(Parser, Debug)]
#[clap(verbatim_doc_comment)]
Copy link
Contributor Author

@olivier-lacroix olivier-lacroix Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we would need to use verbatim_doc_comment for every comment, so that --help shows something readable. As the raw text will be displayed in the terminal we will need to decide how much markdown we accept in here.

@ruben-arts
Copy link
Contributor

This is definetly the way forward, but I think we should fork/vendor the implementation and make sure we can split up the document a little more.

@olivier-lacroix
Copy link
Contributor Author

@ruben-arts would indenting sub-commands in that single page markdown be enough? or generating separate pages is a must?

@olivier-lacroix
Copy link
Contributor Author

@ruben-arts I have matched current CLI.md indentation levels. let me know if this is okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogenerated CLI documentation
2 participants