mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 10:08:40 +00:00
commit
ae425d43c3
11 changed files with 362 additions and 6 deletions
|
@ -20,15 +20,16 @@ Welcome to Rich's documentation!
|
|||
traceback.rst
|
||||
prompt.rst
|
||||
|
||||
tables.rst
|
||||
columns.rst
|
||||
group.rst
|
||||
live.rst
|
||||
markdown.rst
|
||||
padding.rst
|
||||
panel.rst
|
||||
group.rst
|
||||
columns.rst
|
||||
live.rst
|
||||
progress.rst
|
||||
markdown.rst
|
||||
syntax.rst
|
||||
tables.rst
|
||||
tree.rst
|
||||
|
||||
protocol.rst
|
||||
|
||||
|
|
|
@ -35,4 +35,5 @@ Reference
|
|||
reference/text.rst
|
||||
reference/theme.rst
|
||||
reference/traceback.rst
|
||||
reference/tree.rst
|
||||
references/abc.rst
|
||||
|
|
|
@ -9,7 +9,10 @@ You can consider this class to be like a string with marked up regions of text.
|
|||
|
||||
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::
|
||||
|
||||
from rich.console import Console
|
||||
from rich.text import Text
|
||||
|
||||
console = Console()
|
||||
text = Text("Hello, World!")
|
||||
text.stylize("bold magenta", 0, 6)
|
||||
console.print(text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue