This commit is contained in:
Will McGugan 2020-05-08 15:03:16 +01:00
parent 5c028214a6
commit 20078d6d19
2 changed files with 9 additions and 1 deletions

View File

@ -19,3 +19,11 @@ Rich can render Markdown to the console. To render markdown, construct a :class:
console.print(md)
Note that code blocks are rendered with full syntax highlighting!
You can also use the Markdown class from the command line. The following example displays a readme in the terminal::
python -m rich.markdown README.md
Run the following to see the full list of arguments for the markdown command::
python -m rich.markdown -h

View File

@ -3,7 +3,7 @@
Rich Text
=========
Rich has a :class:`~rich.text.Text` class which you can use to mark up strings with color and style attributes. You can consider this class to be like a mutable string with additional style information.
Rich has a :class:`~rich.text.Text` class you can use to mark up strings with color and style attributes. You can consider this class to be a mutable string with additional style information.
One way to add a style to Text is the :meth:`~rich.text.Text.stylize` method which applies a style to a start and end offset. Here is an example::