Skip to main content

Module export

Module export 

Source
Expand description

Exporting rendered output to HTML.

Port of rich/console.py’s export_html + the _export_format.py template. Turns a recorded stream of Segments (captured via Console::export_html) into a self-contained HTML document, using a TerminalTheme to resolve colors.

Scope: inline_styles (each span carries its own style="…"). The CSS-class variant is a follow-up (see docs/DIVERGENCES.md).

Functions§

export_html_classes
Render segments to a self-contained HTML document using CSS classes and a generated stylesheet. Port of Console.export_html(inline_styles=False) (upstream’s default). Distinct styles are numbered .r1, .r2, … in the order first seen.
export_html_inline
Render segments to a self-contained HTML document with inline styles. Port of Console.export_html(inline_styles=True).