Skip to content

Commit 1b43786

Browse files
committed
docs
1 parent 06279f7 commit 1b43786

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/source/text.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Rich Text
33

44
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.
55

6-
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::
6+
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::
77

88
from rich.text import Text
99
text = Text("Hello, World!")

rich/text.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def stylize(self, start: int, end: int, style: Union[str, Style]) -> None:
217217
Args:
218218
start (int): Start offset.
219219
end (int): End offset.
220-
style (str): Style name to apply.
220+
style (Union[str, Style]): Style instance or style definition to apply.
221221
222222
Returns:
223223
None:
@@ -235,7 +235,8 @@ def highlight_regex(
235235
translated to styles.
236236
237237
Args:
238-
re_highlight (str): A regular expression
238+
re_highlight (str): A regular expression.
239+
style (Union[str, Style]): Optional style to apply to whole match.
239240
240241
Returns:
241242
int: Number of regex matches

0 commit comments

Comments
 (0)