Manual variants design
This note records why the Manual pane merges two rendering paths behind one component and one toggle.
The problem
facett had two separate documentation paths:
- facett-docview — a Typst-authored manual exported as one vector SVG per page, rendered with pure-Rust resvg. Pretty and typeset, but historically fed from host-generated pages.
- facett-manual — a continuous, searchable Markdown viewer that reused the facett-markdown renderer. Simple and warehouse-free.
Users had to choose the crate up front. There was no single pane that could show both, and neither embedded its own content — the host had to supply it.
The decision
Merge them. One ManualPane now owns both:
- an embedded typeset SVG book (prebuilt vector pages,
include_bytes!), and - an embedded set of Markdown sources (
include_str!).
A Variant enum selects which renders. The default is Typeset (SVG) — the pretty variant — and a header toggle switches to Markdown. The Typeset variant delegates to the facett-docview engine, so all of its reader chrome (sidebar, zoom, continuous / paged, search) comes for free.
Why embed
Embedding the content compiles the manual into the binary. There is no runtime disk dependency, so the manual ships regardless of whether the host wired up a docview book, and it works on an airgapped machine with zero system fonts (the docview engine carries an embedded DejaVu Sans fallback).