The engine
The engine is what turns your manuscript into a book: Pandoc, the Lua filters and handlers that interpret Keystone's markup, TeX Live, and bundled fonts — all inside the Keystone image. Every template runs the same engine; some carry its source in your project, some run it from a prebuilt image.
Most authors never need this section. Writing, Configuration and Shortcuts cover making a book and styling it. Come here to understand what happens during a build, or to change how it happens.
Keystone is built to be extended rather than edited. A shortcut composes new markup, a hook brings in a tool of your own, and in a template that carries the source, a new handler is a directory the dispatcher finds. None of that asks the engine to change, so it comes through an upgrade intact — you reconcile config and rewrite nothing. Editing a file the engine ships is the other path, and from then on each upgrade brings changes that are yours to merge in.
The build
- Build pipeline — the path from
make publishto a finished artifact, and the order the stages run in. - Sandboxing — the locked-down container every build runs in, and what that buys you: reproducible builds, and safety when the source isn't yours.
- The runtime image — what the image contains, how it's assembled, and how a LaTeX package is added to it.
The code
Changing any of it takes a template that carries the source under .pandoc/,
where make image rebuilds the image from your edits;
Choosing a template marks the ones that do.
- Customizing — where the boundary falls between what a shortcut composes and what needs engine code. Start here.
- Handlers — the code behind a fenced div or span class, and how the dispatcher routes elements to it.
- Writing a handler — building one end to end.
- Format integration — what a handler owes each output format.
- The AST library (KAST) — the single seam every filter and handler goes through to touch the document tree.
- Validation & diagnostics — how the checks behind How Keystone checks your book are implemented, and how to add your own.