-
-
Notifications
You must be signed in to change notification settings - Fork 824
✨ Add support for rich_help_panel of commands in generated docs
#828
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
base: master
Are you sure you want to change the base?
✨ Add support for rich_help_panel of commands in generated docs
#828
Conversation
|
I added the tests to verify the cases with default ( |
|
As clarified at #830, |
|
Tricky merge conflict with #944, which has changed the order of commands being displayed. Should be all good and green again. |
|
@svlandeg, many thanks for checking this out and fixing the merge conflicts! 🙏 |
svlandeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a nice feature! I tested it with
typer docs_src/commands/help/tutorial006.py utils docs
to see the difference between master and this PR, and you nicely get the subdivision in the markdown with this PR:

whereas on master it's just:
There's a few issues with the code though. I'll comment inline, and will put the PR in draft as I push some changes.
rich_help_panel of commands in generated docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready for review by Tiangolo.
One final remark I have here is that this code is not tested in our test suite without having rich installed. This is why the initial implementation didn't result in a test failure, while it really should have. #1297 should improve that situation (that said, I think these PRs can be reviewed/merged independently).
This comment was marked as resolved.
This comment was marked as resolved.
…ttps://github.com/kinuax/typer into add-support-for-rich_help_panel-in-generated-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, something seems to have been broken after merging master, maybe there is a merge conflict that wasn't handled correctly, or there is an interdependency with another PR. test_doc_no_rich doesn't show the "Greet" and "Farewell" headers anymore, though test_doc_title_output does 🤔 I'll continue to investigate.
UPDATE: wait, so actually isn't this correct? The option is called rich_help_panel, so it shouldn't affect non-Rich output, right? I'm going to update the PR to reflect this.
…ttps://github.com/kinuax/typer into add-support-for-rich_help_panel-in-generated-docs
| @@ -0,0 +1,102 @@ | |||
| # `multiapp` | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically the same file as what multiapp-docs.md was before, without the "Greet" and "Farewell" headers.
| "-m", | ||
| "typer", | ||
| "tests/assets/cli/empty_script.py", | ||
| "tests.assets.cli.empty_script", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drive-by edit that is not necessary for this PR 🤷
The generated Markdown docs ignore the division given by
rich_help_panelwhile listing the commands. This is a proposal to support it.