This commit is contained in:
Will McGugan 2020-03-02 17:32:47 +00:00
parent 06279f7605
commit 1b43786646
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@ Rich Text
Rich has a :class:`~rich.text.Text` class for text that may be marked up with color and style attributes. You can consider this class to be like a mutable string with style information. The methods on the Text() instance are similar to a Python ``str`` but are designed to preserve any style information.
One way to add a style to Text is the :meth:`~tich.text.Text.stylize` method which applies a style to a start and end offset. Here is an example::
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.text import Text
text = Text("Hello, World!")

View File

@ -217,7 +217,7 @@ class Text:
Args:
start (int): Start offset.
end (int): End offset.
style (str): Style name to apply.
style (Union[str, Style]): Style instance or style definition to apply.
Returns:
None:
@ -235,7 +235,8 @@ class Text:
translated to styles.
Args:
re_highlight (str): A regular expression
re_highlight (str): A regular expression.
style (Union[str, Style]): Optional style to apply to whole match.
Returns:
int: Number of regex matches