book.toml reference
A book is a directory with a book.toml and the Markdown it points to. All paths are relative to the directory holding book.toml. Globs are expanded with ** support and sorted naturally (2-x.md before 10-x.md). A glob that matches nothing is an error, so typos never silently drop a chapter.
[book]
| key | type | notes |
|---|---|---|
title |
string | required. Markdown emphasis is allowed in the title page; metadata uses the raw text. |
subtitle |
string | Emitted as a second dc:title with title-type=subtitle. |
authors |
list of strings | One dc:creator (role aut) each. A bare string is accepted for a single author. |
language |
string | BCP 47 tag, default en. Drives smart quotes (en, fr, de; other tags fall back to English) and the "Notes" heading. |
identifier |
string | An ISBN (978-0-306-40615-7, ISBN 0-306-40615-2), a urn:/URL, or any string. ISBNs become urn:isbn:.... When omitted a deterministic urn:uuid: (UUIDv5 of title and authors) is used, so rebuilding never changes the book's identity. |
publisher, description, rights |
string | Optional metadata. rights also feeds the {rights} copyright placeholder. |
date |
string | Publication date, e.g. 2026-03-14. Its year feeds {year}; without it the current year is used. |
subjects |
list of strings | One dc:subject each. |
cover |
path | PNG/JPEG/GIF/WebP/SVG. Becomes the cover-image manifest item, a cover.xhtml first spine page, and the first page of the print edition. |
[content]
[content]
chapters = ["chapters/*.md"] # default
Chapter ids come from the file name with any leading number stripped (01-the-door.md is the-door), or from id: in the chapter's front matter. Ids must start with a letter, be unique across the whole book, and must not be cover, titlepage, toc or nav.
[[parts]]
[[parts]]
title = "Part One: Low Water"
chapters = ["chapters/0[1-3]-*.md"]
When any [[parts]] exist they replace content.chapters. Each part gets its own title page (EPUB: part-*.xhtml), a nesting level in the nav/NCX and a TOC group in print. A file may belong to only one part.
[matter]
| key | file | notes |
|---|---|---|
dedication |
Markdown | Centered italic page after the copyright page. |
copyright |
Markdown template | Placeholders {title} {subtitle} {authors} {year} {publisher} {identifier} {language} {rights}; unknown {names} are left alone. Omitted: a page is generated from the metadata. |
appendices |
list of globs | Back matter after the last chapter, included in the TOC. |
acknowledgements, about_author |
Markdown | Back matter, included in the TOC. |
Back-matter order is appendices, acknowledgements, about the author. A missing # Heading is added automatically from the title.
Chapter files
---
id: the-door # optional
title: The Door # optional; default is the first "# " heading
---
# The Door
> Epigraph text.
>
> --- Attribution
- The block quote directly after the chapter heading is an epigraph; a final paragraph of any quote that begins with
---/an em dash is styled as an attribution. ***,---or___on their own line is a scene break, rendered asstyle.scene_break.[@chapter-id]becomes a link whose text is that chapter's title;[text](other-file.md#anchor)is rewritten to the right chapter. Unknown targets fail the build.- Footnotes use
[^label]/[^label]: text. - Images are paths relative to the Markdown file.
alone in a paragraph becomes a<figure>with a<figcaption>. - Raw HTML is escaped, never passed through.
[style]
| key | values | default |
|---|---|---|
theme |
classic, modern, manuscript |
classic |
first_line |
smallcaps, dropcap, none |
smallcaps |
footnotes |
footnotes (pop-up asides), endnotes (list per chapter) |
footnotes |
scene_break |
any string | * * * |
toc_depth |
1 chapters only, 2 adds ##, 3 adds ### |
2 |
code_style |
any Pygments style name | friendly |
css |
path to extra CSS appended last | none |
fonts |
array of {family, path, weight?, style?} |
none |
Fonts (.ttf .otf .woff .woff2) are embedded in the EPUB under fonts/ and as base64 in the print HTML. The first family becomes the body font. No obfuscation is applied; use fonts whose license allows embedding (OFL fonts are fine).
[[style.fonts]]
family = "EB Garamond"
path = "fonts/EBGaramond-Regular.ttf"
[print]
| key | meaning | default |
|---|---|---|
page_size |
CSS @page size |
5.5in 8.5in |
margin |
CSS @page margin |
0.8in 0.7in 0.9in 0.7in |
font_size |
root font size | 10.5pt |
chapter_start |
any or right (start chapters on recto pages) |
any |
running_header |
book (author on left pages, title on right), chapter (title on left, chapter title on right), none |
book |
[stats]
words_per_minute (default 230) sets the reading-time estimate.