Exporting
export # interactive format pickerexport pdf epub # one or more formats (positional)export --format pdf # or via --format: epub · html · docx · txt · mdexport all # every format at once| Format | Engine | Notes |
|---|---|---|
| xhtml2pdf | A4, new page per chapter; code blocks wrap instead of clipping; SVG diagrams render as vector art (svglib) or rasterize via cairosvg when installed | |
| EPUB | ebooklib | One spine item per section, real TOC, images packaged as items, code-wrap CSS |
| HTML | python-markdown | Single self-contained file - CSS embedded, images inlined as data URIs |
| DOCX | pandoc | Needs pandoc on PATH; syntax highlighting; images via --resource-path |
| TXT | built-in | Markdown stripped to clean plain text |
| MD | built-in | The raw manuscript, normalized |
Generated diagrams
Section titled “Generated diagrams”With use_images: true (default), each eligible non-fiction section/chapter gets a
figure: a Wikimedia Commons image when one fits, otherwise a generated SVG diagram.
For the SVG, the pro model authors a structured spec (nodes, edges, labels,
archetype) - it never draws the SVG itself; a deterministic renderer lays everything
out so labels never overflow and edges never collide. Archetypes are flow (pipelines,
architectures, decision flows), layered lanes, comparison, and cycle, with a typography
hierarchy, labeled edge pills, real metrics from your content as on-figure annotations,
and exactly one focal emphasis.
Two deterministic guards back the prompt:
- a fill guard forces
fill="none"onto every connector path (a missed one renders as a giant black polygon - models forget this constantly); - a flash fallback draws the figure if the pro tier emits no SVG, so a placeholder never ships.
Mermaid code blocks in the manuscript are rendered to PNG (via mermaid.ink, cached on disk per diagram) so they export as images everywhere instead of raw source.
Output fidelity details you’d otherwise discover the hard way
Section titled “Output fidelity details you’d otherwise discover the hard way”- Unicode the PDF serif can’t render (non-breaking hyphens, narrow spaces) is normalized - no tofu boxes.
- A leftover
[AUTHOR NAME]placeholder byline is dropped rather than printed. ---separators are protected from pandoc’s YAML-metadata interpretation.- Exported HTML is sanitized: no scripts, iframes, or event handlers survive.
Re-export without a model call
Section titled “Re-export without a model call”Already generated a piece? polish re-runs the deterministic references, citation, and figure
cleanup and re-exports every format - no LLM call (~0 tokens). It’s the cheap way to refresh
exports after a tweak. See Quality machinery.
Rewrite in a different voice (restyle)
Section titled “Rewrite in a different voice (restyle)”Export renders the piece as written. To ship the same argument in a different voice without re-running the pipeline, restyle it - a single flash-tier call that re-voices a finished manuscript into a target style (register) / persona / emotion, preserving structure, citations, and facts:
- In the web dashboard the Project → Export tab has a Rewrite control (pick any of style / persona / emotion, then Rewrite).
- The restyled copy is written to
restyled/<combo>.md- the original manuscript is untouched, so it’s a safe, additive experiment you can throw away.
Under the hood it’s the same repurposing engine as SEO & promotion: facts are preserved; only the voice changes.