Expand description
Export conversation sessions to standalone HTML files.
Produces a self-contained HTML document with embedded CSS and JS that renders a conversation session with:
- Color-coded user / assistant / system messages
- Markdown → HTML rendering (basic, no external deps)
- ANSI escape code → HTML span conversion (full 256-color + true-color support)
- Tool calls and results in styled blocks (bash, file ops, search)
- Collapsible thinking blocks
- Metadata header (model, provider, date, token counts)
- Dark theme (default) with light-theme toggle
- Syntax highlighting for code blocks (via highlight.js CDN)
- Session tree navigation for branched sessions
Structs§
- Export
Meta - Metadata attached to an export (optional but encouraged).
- Html
Export Options - Options for HTML export.
- Tree
Node - A single rendered node in the session tree.
Functions§
- ansi_
lines_ to_ html - Convert an array of ANSI-escaped lines to HTML.
Each line is wrapped in a
<div class="ansi-line">element. - ansi_
to_ html - Convert ANSI-escaped text to HTML with inline styles.
- export_
html - Render a flat list of session entries into a self-contained HTML string.
- export_
html_ with_ options - Render a flat list of session entries into a self-contained HTML string
with fine-grained control over the output via
HtmlExportOptions. - export_
to_ html - Convenience function: export session entries to an HTML string using the
given
HtmlExportOptions.