diff --git a/docs/api/index.md b/docs/api/index.md index c809557d8..989244f2c 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -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. diff --git a/src/textual/_doc.py b/src/textual/_doc.py index e2a0be195..329fc73db 100644 --- a/src/textual/_doc.py +++ b/src/textual/_doc.py @@ -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) diff --git a/src/textual/color.py b/src/textual/color.py index e836452cb..a53a0abaf 100644 --- a/src/textual/color.py +++ b/src/textual/color.py @@ -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