-
-
Notifications
You must be signed in to change notification settings - Fork 785
✨ Render Rich markup as HTML in Markdown docs #847
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
Merged
+122
−7
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
bbe538d
Create rich_to_html util function
svlandeg c814412
_parse_html helper function
svlandeg 4873417
add strip() to avoid additional newlines
svlandeg fbdd28e
avoid cropping and bold highlighting
svlandeg 2acd603
escape non-rich formatting such as extra information
svlandeg 38a14cc
add unit test
svlandeg 5543626
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
pre-commit-ci[bot] 924ba90
Merge branch 'master' into feat/markup
svlandeg 56c6a5b
(hopefully) fix test for Windows
svlandeg df9febd
print statements to debug CI issue
svlandeg b80ba1b
add env to each test
svlandeg 74e177d
Add encoding argument to read_text function
svlandeg 4d9343e
Add encoding argument to read_text function (2)
svlandeg 6b96334
drop coverage part of the command
svlandeg ee59aaf
remove emoji
svlandeg 98af2cd
cleanup
svlandeg 4445c05
add no cover statement
svlandeg c9aa784
add no cover statement (2)
svlandeg f0eaf0d
Merge branch 'master' into feat/markup
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
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 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,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 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
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.
Uh oh!
There was an error while loading. Please reload this page.