mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
docs
This commit is contained in:
parent
a68bae9f9b
commit
c9ce00abe0
8 changed files with 153 additions and 72 deletions
|
@ -1,3 +1,23 @@
|
|||
Console API
|
||||
===========
|
||||
|
||||
For more finely grained control over terminal formatting, Rich offers a :class:`~rich.console.Console` class. Most applications will require a single Console instance, so you may want to create one at the module level or as an attribute of your top-level object.
|
||||
|
||||
from rich.console import Console
|
||||
console = Console()
|
||||
|
||||
|
||||
Attributes
|
||||
----------
|
||||
|
||||
The console will auto-detect a number of properties required when rendering.
|
||||
|
||||
* :obj:`~rich.console.Console.size` is the current dimensions of the terminal (which may change if you resize the window).
|
||||
* :obj:`~rich.console.Console.encoding` is the default encoding (typically "utf-8").
|
||||
* :obj:`~rich.console.Console.is_terminal` is a boolean that indicates if the Console instance is writing to a terminal or not.
|
||||
* :obj:`~rich.console.Console.color_system` is a string containing "standard", "256" or "truecolor", or `None` if not writing to a terminal.
|
||||
|
||||
|
||||
Printing
|
||||
--------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue