mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
docs and rule
This commit is contained in:
parent
6d7ba589e2
commit
f9ac1c2f54
8 changed files with 21 additions and 13 deletions
|
@ -39,7 +39,7 @@ Setting the highlighter on the Console will apply highlighting to all text you p
|
|||
console.print(highlight_emails("Send funds to money@example.org"))
|
||||
|
||||
|
||||
While :class:`~rich.highlighter.RegexHighlighter` is quite powerful, you can also extend its base class :class:`~rich.highlighter.Highlighter` which you can use to implement any scheme for highlighting. It contains a single method :class:`~rich.highlighter.Highlighter.highlight` which is passed the :class:`~rich.text.Text` to highlight.
|
||||
While :class:`~rich.highlighter.RegexHighlighter` is quite powerful, you can also extend its base class :class:`~rich.highlighter.Highlighter` to implement a custom scheme for highlighting. It contains a single method :class:`~rich.highlighter.Highlighter.highlight` which is passed the :class:`~rich.text.Text` to highlight.
|
||||
|
||||
Here's a silly example that highlights every character with a different color::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue