Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

facett-manual/embedded/manual-variants-design.md

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:

  1. 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.
  2. 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:

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).