Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Feb 22, 2022
1 parent f2845e1 commit 21432b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/source/highlighting.rst
@@ -1,3 +1,5 @@
.. _highlighting:

Highlighting
============

Expand Down
12 changes: 6 additions & 6 deletions docs/source/introduction.rst
@@ -1,7 +1,7 @@
Introduction
============

Rich is a Python library for writing *rich* text (with color and style) to the terminal, and for displaying advanced content such as tables, markdown, and syntax highlighted code.
Rich is a Python library for writing *rich* text (with color and style) to the terminal, and for displaying advanced content such as tables, markdown, and syntax highlighted code.

Use Rich to make your command line applications visually appealing and present data in a more readable way. Rich can also be a useful debugging aid by pretty printing and syntax highlighting data structures.

Expand Down Expand Up @@ -38,7 +38,7 @@ The quickest way to get up and running with Rich is to import the alternative ``

from rich import print

You can then print strings or objects to the terminal in the usual way. Rich will do some basic syntax highlighting and format data structures to make them easier to read.
You can then print strings or objects to the terminal in the usual way. Rich will do some basic syntax :ref:`highlighting<highlighting>` and format data structures to make them easier to read.

Strings may contain :ref:`console_markup` which can be used to insert color and styles in to the output.

Expand All @@ -50,7 +50,7 @@ This writes the following output to the terminal (including all the colors and s

.. raw:: html

<pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"><span style="color: #800000; font-style: italic">Hello</span> World!
<pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"><span style="color: #800000; font-style: italic">Hello</span> World!
<span style="font-weight: bold">{</span>
<span style="color: #008000">'__annotations__'</span>: <span style="font-weight: bold">{}</span>,
<span style="color: #008000">'__builtins__'</span>: <span style="font-weight: bold"><</span><span style="color: #ff00ff">module</span><span style="color: #000000"> </span><span style="color: #008000">'builtins'</span><span style="color: #000000"> </span><span style="color: #000000; font-weight: bold">(</span><span style="color: #000000">built-in</span><span style="color: #000000; font-weight: bold">)</span><span style="font-weight: bold">></span>,
Expand All @@ -75,7 +75,7 @@ Rich in the REPL
Rich may be installed in the REPL so that Python data structures are automatically pretty printed with syntax highlighting. Here's how::

>>> from rich import pretty
>>> pretty.install()
>>> pretty.install()
>>> ["Rich and pretty", True]

You can also use this feature to try out Rich *renderables*. Here's an example::
Expand All @@ -91,8 +91,8 @@ IPython Extension
Rich also includes an IPython extension that will do this same pretty install + pretty tracebacks. Here's how to load it::

In [1]: %load_ext rich
You can also have it load by default by adding `"rich"` to the ``c.InteractiveShellApp.extension`` variable in

You can also have it load by default by adding `"rich"` to the ``c.InteractiveShellApp.extension`` variable in
`IPython Configuration <https://ipython.readthedocs.io/en/stable/config/intro.html>`_.

Rich Inspect
Expand Down

0 comments on commit 21432b4

Please sign in to comment.