-
-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Render Rich markup as HTML in Markdown docs (#847)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a6167b3
commit 5996fc1
Showing
6 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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,22 @@ | ||
import typer | ||
from typing_extensions import Annotated | ||
|
||
app = typer.Typer(rich_markup_mode="rich") | ||
|
||
|
||
@app.command(help="Say [bold red]hello[/bold red] to the user.") | ||
def hello( | ||
user_1: Annotated[ | ||
str, | ||
typer.Argument(help="The [bold]cool[/bold] name of the [green]user[/green]"), | ||
], | ||
user_2: Annotated[str, typer.Argument(help="The world")] = "The World", | ||
force: Annotated[ | ||
bool, typer.Option(help="Force the welcome [red]message[/red]") | ||
] = False, | ||
): | ||
print(f"Hello {user_1} and {user_2}") # pragma: no cover | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
This file contains 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,21 @@ | ||
# Awesome CLI | ||
|
||
Say <span style="color: #800000; text-decoration-color: #800000; font-weight: bold">hello</span> to the user. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ hello [OPTIONS] USER_1 [USER_2] | ||
``` | ||
|
||
**Arguments**: | ||
|
||
* `USER_1`: The <span style="font-weight: bold">cool</span> name of the <span style="color: #008000; text-decoration-color: #008000">user</span> [required] | ||
* `[USER_2]`: The world [default: The World] | ||
|
||
**Options**: | ||
|
||
* `--force / --no-force`: Force the welcome <span style="color: #800000; text-decoration-color: #800000">message</span> [default: no-force] | ||
* `--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. |
This file contains 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 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 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 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