Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Mar 2, 2020
1 parent 06279f7 commit 1b43786
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
5 changes: 3 additions & 2 deletions rich/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def stylize(self, start: int, end: int, style: Union[str, Style]) -> None:
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:
Expand All @@ -235,7 +235,8 @@ def highlight_regex(
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
Expand Down

0 comments on commit 1b43786

Please sign in to comment.