Skip to content

auto generate command line docs for CLI#939

Merged
hansent merged 2 commits into
mainfrom
cli-docs
Jan 13, 2025
Merged

auto generate command line docs for CLI#939
hansent merged 2 commits into
mainfrom
cli-docs

Conversation

@hansent
Copy link
Copy Markdown
Collaborator

@hansent hansent commented Jan 13, 2025

Description

auto generate command line docs for CLI using typer command line tool.

This is loosely based on the code from https://github.com/syn54x/mkdocs-typer2

I tried both the existing mkdocs-typer and mkdocs-typer2 pip packages, but couldn't get either to work. The first one hasn't been updated for 3 years and I couldn't get it to generate anything.

mkdocs-typer2 hooked / tried to generate, but failed internally trying to update the html tree with ParseError: mismatched tag: line 449, column 3. Looking at the sourcecode I saw it used the typer command line tool to generate markdown and then generate html from it. I think the error is either in the generated HTML or because of the way its tryin to hook it into our material theme.

So instead I just added a script like the other docs generation scripts we have and write the markdown directly

IT looks like this when renderd:
CleanShot 2025-01-13 at 16 26 33@2x

Type of change

New reference docs for CLI interface

How has this change been tested, please provide a testcase or example of how you tested the change?

locally running the script and mkdocs serve

Any specific deployment considerations

docs only

Docs

auto generates cli interace docs

Copy link
Copy Markdown
Contributor

@yeldarby yeldarby left a comment

Choose a reason for hiding this comment

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

Nice!

@hansent hansent merged commit c2b5b9f into main Jan 13, 2025
@hansent hansent deleted the cli-docs branch January 13, 2025 23:05
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.

2 participants