Repository navigation
Home
A programmable typesetter for the web.
Postext is a browser-native layout engine that brings the rules of print typesetting to the web. It takes enriched markdown with figures, tables, notes and citations, and sets it as a book or a magazine: columns that end level, no orphans or widows, hyphenation, floats, footnotes, running heads, a table of contents and an index. The same layout comes out as canvas, HTML, PDF, EPUB 3 or a 3D book.
It is built on @chenglou/pretext for DOM-free text measurement.
- Repository: drnachio/postext
- Website, docs, Sandbox and Cookbook: postext.dev, in English, Spanish, Catalan, Portuguese, French, German, Italian, Chinese, Japanese and Arabic
-
npm:
postext,postext-pdf,postext-epub,postext-folio,postext-citeproc,postext-cli - Command line: one self-contained executable per system, on every release (see Command Line)
- License: MIT
- Introduction — what Postext is and the problem it solves.
- Features — everything it does today, with links to the details.
- Getting Started — install, first layout, PDF, EPUB, 3D book, worker.
- Sandbox — the in-browser editor at postext.dev/en/sandbox, with pages on its Design and Checks panels, previews, books, Word files and saving and embedding.
- Cookbook and Showcase — complete examples and the showcase books.
- Document Format — the markdown Postext reads, in five pages: the basics · directives · inline formatting and formulas · notes and references · pictures, tables and videos
- Configuration — every setting, split into: page and layout · headers and footers · body text · hyphenation and language · headings · widows, orphans and balancing · lists and maths · notes and references · East Asian typography · resources · styles · callout boxes · comics · composed pages · fonts, colours and viewers
- Hyphenation and Justification — Knuth-Plass line breaking and hyphenation.
- Chinese Layout, Japanese Layout and Arabic Layout — guides to books in those scripts.
- Comics — comic pages, manga and newspaper strips: panels, lettering and reading direction.
- Composed Pages — pages built from a template of frames and slots, and spreads of two facing pages.
-
Agent Skill —
postext-port, for turning existing publications into Postext projects with a coding agent. -
Command Line —
postext, one executable for macOS, Linux and Windows: PDF, HTML, EPUB, page images, Word, bundles and checks, with JSON output for scripts and agents. - WebMCP — what an agent in the browser can do with the Sandbox through its 36 WebMCP tools (look at the pages, change any setting, edit the text, add resources, run the checks, export) and the call for each one, with real arguments and answers.
-
Programmatic Usage —
buildDocument, warnings, fonts and workers; then PDF files, the HTML viewer, Folio and EPUB and.postextbundles. - API Reference — the public entry points of every package.
- Packages — what each package does and how they are released.
- Architecture — the Virtual Document Tree and the convergence loop; the layout pipeline has its own page.
- Project Structure — the monorepo map.
- Development Setup — build, test, release.
- Contributing — how to help.
- Roadmap — what is done and what is open.
The doc pages (Introduction, Architecture, Configuration and its pages, Programmatic Usage and its pages, Document Format and its pages, Justification, Chinese, Japanese and Arabic layout, Comics, Composed Pages, Sandbox and its pages, Agent Skill, Command Line, WebMCP, Contributing) are generated from the English MDX in docs/ by apps/web/scripts/wiki/sync.ts. Edit the MDX, then run the script (see Development Setup). The other pages are written here by hand. The illustrated, multilingual version of the docs is at postext.dev/en/docs.
Postext is MIT-licensed. Maintained by Ignacio Ferro and community contributors. See the live documentation for the most up-to-date reference.
Overview
Writing
- Document Format
- Hyphenation and Justification
- Chinese Layout
- Arabic Layout
- Japanese Layout
- Comics
- Composed Pages
- Sandbox
- Agent Skill
- Command Line
- WebMCP
Configuration
- Overview and index
- Page and layout
- Headers and footers
- Body text
- Hyphenation and language
- Headings
- Widows, orphans and balancing
- Lists and maths
- Notes and references
- East Asian typography
- Resources
- Styles and parts
- Callout boxes
- Comics
- Composed pages
- Fonts, colours, viewers
Code
Internals
External