HTML Single Page #
This renderer creates a single self-contained HTML file from your entire documentation. All content, styles, and images are embedded inline, making it ideal for:
- Offline reading and archival
- PDF generation via browser print
- Sharing documentation as a single file
- Portable documentation snapshots
Tip
See a live example: The Rust Programming Language rendered as a single-page document.
Usage #
Build your documentation with the html-single renderer:
romero build --render html-single
Or serve it locally with live reload:
romero serve --render html-single
The output will be a single index.html file in your build directory.
Features #
- Hierarchical Table of Contents — Automatically generated from your SUMMARY.md structure with section headers and numbered entries
- Anchor Links — Every heading has a clickable anchor (section numbers for chapters,
#on hover for content headings) - Embedded Resources — Images are base64-encoded inline, styles included in
<style>tags - Full Markdown Support — Same features as the HTML renderer: GFM, syntax highlighting, admonitions, math, D2 diagrams, code includes, footnotes
- Enhanced Code Includes — Line numbers, context expansion, source links, and copy-to-clipboard buttons
- Rust Playground Integration — Run Rust code examples directly from
{{#rustdoc_include}}blocks - Print Optimized — Clean print styles for PDF generation via browser print function
- Title Deduplication — Automatically removes redundant H1 headings that match chapter titles
Comparison with HTML #
| Feature | HTML | HTML Single |
|---|---|---|
| Output | Multiple files | Single file |
| Navigation | Sidebar + search | Table of contents |
| Images | Separate files | Embedded (base64) |
| Offline | Needs all files | Self-contained |
| File size | Smaller per-page | Larger single file |
| Best for | Websites | Documents, PDFs |
100%