Skip to content

Commit 3a28f96

Browse files
authored
Merge pull request #40 from wasi-master/patch-1
Take `--theme` and `--lexer` into account for Markdown and RST
2 parents 9884ce8 + fe8b7b2 commit 3a28f96

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/rich_cli/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,18 @@ def print_usage() -> None:
561561
from .markdown import Markdown
562562

563563
markdown_data, lexer = read_resource(resource, lexer)
564-
renderable = Markdown(markdown_data, hyperlinks=hyperlinks)
564+
renderable = Markdown(markdown_data, code_theme=theme, hyperlinks=hyperlinks)
565565

566566
elif resource_format == RST:
567567
from rich_rst import RestructuredText
568568

569-
rst_data, lexter = read_resource(resource, lexer)
570-
renderable = RestructuredText(rst_data, show_errors=False)
569+
rst_data, _ = read_resource(resource, lexer)
570+
renderable = RestructuredText(
571+
rst_data,
572+
code_theme=theme,
573+
default_lexer=lexer or "python",
574+
show_errors=False,
575+
)
571576

572577
elif resource_format == INSPECT:
573578
try:

0 commit comments

Comments
 (0)