mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix rich export size
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# API
|
||||
|
||||
This is a API-level reference to the Textual API. See the links on the left (or in the burger menu) for each module, where you can drill down to a class or method.
|
||||
This is a API-level reference to the Textual API. Click the links to your left (or in the burger menu) to open a reference for each module.
|
||||
|
||||
If you are new to Textual, you may want to read the [tutorial](./../tutorial.md) or [guide](../guide/index.md) first.
|
||||
|
||||
@@ -125,11 +125,16 @@ def rich(source, language, css_class, options, md, attrs, **kwargs) -> str:
|
||||
|
||||
title = attrs.get("title", "Rich")
|
||||
|
||||
rows = int(attrs.get("lines", 24))
|
||||
columns = int(attrs.get("columns", 80))
|
||||
|
||||
console = Console(
|
||||
file=io.StringIO(),
|
||||
record=True,
|
||||
force_terminal=True,
|
||||
color_system="truecolor",
|
||||
width=columns,
|
||||
height=rows,
|
||||
)
|
||||
error_console = Console(stderr=True)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ You can convert from a Textual color to a Rich color with the [rich_color][textu
|
||||
|
||||
The following named colors are used by the [parse][textual.color.Color.parse] method.
|
||||
|
||||
```{.rich title="colors"}
|
||||
```{.rich columns="80" title="colors"}
|
||||
from textual._color_constants import COLOR_NAME_TO_RGB
|
||||
from textual.color import Color
|
||||
from rich.table import Table
|
||||
|
||||
Reference in New Issue
Block a user