mirror of https://github.com/Textualize/rich.git
docs
This commit is contained in:
parent
5bf2abc203
commit
5ccd78710f
|
@ -7,4 +7,4 @@ To draw a border around any content construct a :class:`~rich.panel.Panel` objec
|
|||
from rich.panel import Panel
|
||||
print(Panel("Hello, [red]World!"))
|
||||
|
||||
You can draw a panel around anything that Rich knows how to render.
|
||||
You can change the style of the panel by setting the ``box`` argument to the Panel constructor. See :ref:`appendix-box` for a list of available box styles.
|
|
@ -42,4 +42,11 @@ This produces the following output:
|
|||
|
||||
Rich is quite smart about rendering the table. It will adjust the column widths to fit the contents and will wrap text if it doesn't fit. You can also add anything that Rich knows how to render as a title or row cell (even another table)!
|
||||
|
||||
You can set the border style by importing one of the preset :class:`~rich.box.Box` objects and setting the ``box`` argument in the table constructor. Here's an example that modifies the look of the Star Wars table::
|
||||
|
||||
from rich import box
|
||||
table = Table(title="Star Wars Movies", box=box.MINIMAL_DOUBLE_HEAD)
|
||||
|
||||
See :ref:`appendix-box` for other box styles.
|
||||
|
||||
The :class:`~rich.table.Table` class offers a number of configuration options to set the look and feel of the table, including how borders are rendered and the style and alignment of the columns.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "rich"
|
||||
homepage = "https://github.com/willmcgugan/rich"
|
||||
documentation = "https://rich.readthedocs.io/en/latest/"
|
||||
version = "0.8.12"
|
||||
version = "0.8.13"
|
||||
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
||||
authors = ["Will McGugan <willmcgugan@gmail.com>"]
|
||||
license = "MIT"
|
||||
|
|
|
@ -18,7 +18,7 @@ class Panel:
|
|||
"""A console renderable that draws a border around its contents.
|
||||
|
||||
Example::
|
||||
>>> console.print(Panel("Hello, World!))
|
||||
>>> console.print(Panel("Hello, World!"))
|
||||
|
||||
Args:
|
||||
renderable (RenderableType): A console renderable object.
|
||||
|
|
Loading…
Reference in New Issue