mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
hyperlinks docs
This commit is contained in:
parent
802a45a1ac
commit
3ed1735e1d
3 changed files with 22 additions and 0 deletions
|
@ -25,6 +25,16 @@ There is a shorthand for closing a style. If you omit the style name from the cl
|
|||
print("[bold red]Bold and red[/] not bold or red")
|
||||
|
||||
|
||||
Links
|
||||
~~~~~
|
||||
|
||||
Console markup can output hyperlinks with the following syntax: ``[link=URL]text[/link]``. Here's an example::
|
||||
|
||||
print("Visit my [link=https://www.willmcgugan.com]blog[/link]!")
|
||||
|
||||
If your terminal software supports hyperlinks, you will be able to click the word "blog" which will typically open a browser. If your terminal doesn't support hyperlinks, you will see the text but it won't be clickable.
|
||||
|
||||
|
||||
Escaping
|
||||
~~~~~~~~
|
||||
|
||||
|
@ -34,6 +44,7 @@ Occasionally you may want to print something that Rich would interpret as markup
|
|||
>>> print("foo[[bar]]")
|
||||
foo[bar]
|
||||
|
||||
The function :func:`~rich.markup.escape` will handle escape of text for you.
|
||||
|
||||
Rendering Markup
|
||||
----------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue