-
-
Notifications
You must be signed in to change notification settings - Fork 845
✨ 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
Open
kinuax
wants to merge
29
commits into
fastapi:master
Choose a base branch
from
kinuax:add-support-for-rich_help_panel-in-generated-docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
ee6932c
Add support for commands' rich_help_panel in generated docs
kinuax b802512
Fix type
kinuax 80f27a3
Add tests with combination of panels
kinuax 760cf3c
Avoid assignment expressions
kinuax 99e1477
Mix default and custom commands in same app
kinuax 87f7e2d
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
kinuax c0af3cd
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
kinuax bc937f2
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
svlandeg ac013b3
update expected output according to new functionality on master
svlandeg 90d1b3d
remove duplicate part
svlandeg 6386af3
fix output according to new behaviour on master
svlandeg b19abe9
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
svlandeg a0598b5
ensure robustness against rich imports
svlandeg 7d3e71c
fix type annotations
svlandeg 354fe9b
cleanup
svlandeg 27445a8
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
kinuax 59108e5
Fix name
kinuax 9d691e6
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
kinuax b58ae12
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
svlandeg ed0164b
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
kinuax 82b3853
Merge branch 'master' into add-support-for-rich_help_panel-in-generat…
svlandeg 9b4e73c
🎨 Auto format
pre-commit-ci-lite[bot] a7007dd
fix separator
svlandeg 9d53174
Merge branch 'add-support-for-rich_help_panel-in-generated-docs' of h…
svlandeg bed0785
fix import
svlandeg c06352a
don't show the headers if Rich is disabled
svlandeg d4c82b0
🎨 Auto format
pre-commit-ci-lite[bot] ad2211b
fix formatting
svlandeg 011a918
Merge branch 'add-support-for-rich_help_panel-in-generated-docs' of h…
svlandeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # `multiapp` | ||
|
|
||
| Demo App | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp [OPTIONS] COMMAND [ARGS]... | ||
| ``` | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--install-completion`: Install completion for the current shell. | ||
| * `--show-completion`: Show completion for the current shell, to copy it or customize the installation. | ||
| * `--help`: Show this message and exit. | ||
|
|
||
| The end | ||
|
|
||
| **Commands**: | ||
|
|
||
| * `top`: Top command | ||
| * `sub` | ||
|
|
||
| ## `multiapp top` | ||
|
|
||
| Top command | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp top [OPTIONS] | ||
| ``` | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--help`: Show this message and exit. | ||
|
|
||
| ## `multiapp sub` | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp sub [OPTIONS] COMMAND [ARGS]... | ||
| ``` | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--help`: Show this message and exit. | ||
|
|
||
| **Commands**: | ||
|
|
||
| * `hello`: Say Hello | ||
| * `hi`: Say Hi | ||
| * `bye`: Say bye | ||
|
|
||
| ### `multiapp sub hello` | ||
|
|
||
| Say Hello | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp sub hello [OPTIONS] | ||
| ``` | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--name TEXT`: [default: World] | ||
| * `--age INTEGER`: The age of the user [default: 0] | ||
| * `--help`: Show this message and exit. | ||
|
|
||
| ### `multiapp sub hi` | ||
|
|
||
| Say Hi | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp sub hi [OPTIONS] [USER] | ||
| ``` | ||
|
|
||
| **Arguments**: | ||
|
|
||
| * `[USER]`: The name of the user to greet [default: World] | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--help`: Show this message and exit. | ||
|
|
||
| ### `multiapp sub bye` | ||
|
|
||
| Say bye | ||
|
|
||
| **Usage**: | ||
|
|
||
| ```console | ||
| $ multiapp sub bye [OPTIONS] | ||
| ``` | ||
|
|
||
| **Options**: | ||
|
|
||
| * `--help`: Show this message and exit. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,9 @@ def test_doc_no_rich(): | |
| capture_output=True, | ||
| encoding="utf-8", | ||
| ) | ||
| docs_path: Path = Path(__file__).parent.parent / "assets/cli/multiapp-docs.md" | ||
| docs_path: Path = ( | ||
| Path(__file__).parent.parent / "assets/cli/multiapp-docs-norich.md" | ||
| ) | ||
| docs = docs_path.read_text() | ||
| assert docs in result.stdout | ||
| assert "**Arguments**" in result.stdout | ||
|
|
@@ -138,7 +140,7 @@ def test_doc_no_typer(): | |
| "run", | ||
| "-m", | ||
| "typer", | ||
| "tests/assets/cli/empty_script.py", | ||
| "tests.assets.cli.empty_script", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drive-by edit that is not necessary for this PR 🤷 |
||
| "utils", | ||
| "docs", | ||
| ], | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.mdwas before, without the "Greet" and "Farewell" headers.