Skip to content

Cookbook and Showcase

Ignacio Ferro Picón edited this page Oct 5, 2026 · 2 revisions

Cookbook and Showcase

Two collections of finished work set with Postext: the Cookbook, short recipes with their code, and the showcase books, whole publications you can open in the Sandbox.


Cookbook

postext.dev/en/cookbook (Recetario in Spanish) holds 132 recipes. Each one is a real publication — a magazine opener, a textbook page with margin notes, a poem sequence, a data table, a print-ready PDF — and teaches one to three features.

A recipe page shows:

  • the captured pages, and the PDF where the recipe makes one;
  • the whole program (a CodePen that imports Postext from esm.sh), with Copy, Open in CodePen and a .html download;
  • a write-up of the method, with excerpts of the real code, and the pitfalls;
  • a link that opens the recipe in the Sandbox.

Recipes are grouped in ten chapters in three parts:

Part Chapters
I · The page Page & grid · Type & text · Headings & openers
II · The book Running heads & folios · Book structure · Boxes & notes · Figures & images · Tables
III · In practice Complete publications · Output & integration

They can be filtered by feature, genre, level and output, and every recipe is also available as Markdown for agents (/en/cookbook/<slug>.md, listed in llms.txt). Write-ups are in English and Spanish, with Catalan and Chinese translations; some recipes are in Chinese, Japanese or Arabic only.

Writing a recipe

Recipes live in cookbook/, one folder each: recipe.json, the write-ups, the pen and its sample text. The tools run from the repository root:

pnpm cookbook new <slug> --chapter <id>   # scaffold a draft
pnpm cookbook dev <slug>                  # live preview of what the capture runs
pnpm cookbook lint <slug>                 # static checks
pnpm cookbook capture <slug>              # run in Chrome on the released engine, write pages, PDF and .postext
pnpm cookbook coverage                    # features and questions no recipe covers yet

The full guide, with the design bar and the rules the lint enforces, is cookbook/README.md.


Showcase books

The Sandbox library opens with these books. Each is a .postext bundle in apps/web/public/presets, shipped with its pagination so it opens already laid out. Their texts and pictures are public domain or under open licences (CC0, CC BY, CC BY-SA), except Señales, © EEA with reproduction authorised, and the Bioquímica chapter, © Editorial Médica Panamericana; each bundle records its licence and credits.

Book Languages What it shows
Cielo profundo · Deep Sky es, en A two-column astronomy magazine: full-bleed openers, boxes, pull quotes.
Señales 2020 · Signals 2020 es, en A two-column EEA magazine with photo openers, boxes, pull quotes and data panels.
Don Quijote, with Gustave Doré's plates es, en A column-and-a-half literary edition with margin glosses and plates.
Paradise Lost, with Gustave Doré's plates en An annotated verse edition: Verity's notes at the foot of the page and fifty plates.
Pintura española · Spanish Painting es, en A one-column exhibition catalogue, entry and commentary facing the full-page plate.
Física universitaria · Physics (OpenStax) es, en A column-and-a-half textbook with worked examples, checks, tables and formulas.
Bioquímica, chapter 1 (Feduchi et al.) es, en A column-and-a-half textbook, the main column at the spine and an outer column of figures, key concepts and activities.
紅樓夢 · Dream of the Red Chamber zh-Hant, zh-Hans, en 120 chapters with the 1884 plates: Traditional Chinese set vertically and bound on the right, Simplified Chinese, and Joly's English translation.
こころ · Kokoro ja Natsume Sōseki's 1914 novel set vertically and bound on the right after the Iwanami first edition, with the cover, endpapers and title page Sōseki designed, three of his paintings and furigana over the harder words.
ألف ليلة وليلة · One Thousand and One Nights ar The Bulaq text, bound on the right, with a double-ruled frame and Sani ol-Molk's watercolours.

The Sandbox also carries the Postext guide, a book about Postext set with Postext, in English, Spanish, Catalan, Chinese and Japanese (set vertically) and Arabic (right to left).

How they are built

Each book has a source pipeline under scripts/presets/showcase (fetch, clean and convert the text and pictures, then write the bundle). The Release workflow regenerates their layouts (layouts.<locale>.json) for each new engine version, so the Sandbox never opens them with stale pagination. See scripts/presets/README.md.

Clone this wiki locally