Textualize / rich-cli

Rich-cli is a command line toolbox for fancy output in the terminal
https://www.textualize.io
MIT License
2.99k stars 77 forks source link

Allow theme and lexer for RST and Markdown printing #35

Closed wasi-master closed 2 years ago

wasi-master commented 2 years ago

As it stands currently, rich-cli prints the rst/markdown document without considering the lexer or theme argument

Markdown: https://github.com/Textualize/rich-cli/blob/main/src/rich_cli/__main__.py#L564 RST: https://github.com/Textualize/rich-cli/blob/main/src/rich_cli/__main__.py#L570

What I suggest is to get the --theme argument and pass it to the code_theme keyword argument of the Markdown and RestructuredText class, and optionally the --lexer argument to the default_lexer parameter of the RestructuredText class

I may open a PR later if @willmcgugan is intrested

willmcgugan commented 2 years ago

Makes sense! 👍

wasi-master commented 2 years ago

PR coming :)