prescription.renderers.console

ConsoleRenderer — rich terminal output.

Kramer Harrison, 2026

Classes

ConsoleRenderer()

Renders a Document to the terminal using the 'rich' library.

class ConsoleRenderer[source]

Renders a Document to the terminal using the ‘rich’ library.

print(document: Document) None[source]
render(document: Document) str[source]

Return the rendered document as a string.

Parameters:

document – The document model to render.

Returns:

Rendered string (plain text, rich markup, or file path for PDF).

write(document: Document, path: str | os.PathLike) None[source]

Render and write to a file.

Parameters:
  • document – The document model to render.

  • path – Output file path.