Skip to content

typoteka.json ​

Every book is a folder with a typoteka.json at its root. The editor writes it when you save or export a project; you can also edit it by hand.

json
{
  "title": "Frankenstein",
  "language": "en-GB",
  "style": { "preset": "novel", "options": { "pageSize": "A4" } },
  "files": {
    "content": ["frankenstein.md"],
    "assets": ["images/*"]
  }
}

title ​

The book's title. Styles that print the title in their running heads or footers read it from here, so it belongs here rather than in the style.

language ​

A BCP 47 language tag (en-GB, es-ES, …). The book is laid out in that language: words are hyphenated by its rules, and a style can choose text for its margins by language (see Page margins). Straight double quotes (") become the language's quotation marks: “ ” in English and in Brazilian Portuguese, « » in Spanish, Catalan, Italian, Portuguese and Swiss German, „ “ in German, and « » with a narrow no-break space inside them in French (also guillemets you type yourself). Other languages get the English ones. Single quotes (') are always ‘ ’, because a straight single quote is also the apostrophe; type any other marks as they are and they are kept.

binding ​

How the left and right margins sit. "bound" (the default) is for a book that will be bound: each style's inner margin, toward the spine, stays wider than the outer one, mirrored on facing pages. "centred" is for loose pages, such as a short PDF: both sides take the narrower of the two, so every page is centred. Covers keep their own layout either way.

json
"binding": "centred"

chapterHeadings ​

true makes every # heading start a chapter, the way a ::: chapter block does: a new page, or a right-hand one in the styles that start chapters there. Off (the default), chapters are ::: chapter blocks, and a # is a heading like any other. See Markdown Basics.

json
"chapterHeadings": true

coverPage ​

true makes the first page a cover: no margins, and nothing in them (no running head, no page number), for an image that fills the page. Off (the default), the first page is laid out like any other. A ::: cover block in the text does this for the page it is on, wherever it is, and makes its image fill that page (see Covers).

json
"coverPage": true

bleed ​

The bleed, in millimetres: 3 by default, from 0 to 20 in steps of 0.5. The bleed guide shows it around each page on screen, and Save PDF for print adds it on every side of each page. Save PDF does not (see Export). An image whose block names bleed or a bleed-<side> reaches exactly this far past the trim (see To the edge of the page).

json
"bleed": 5

cropMarks ​

false leaves the crop marks out of Save PDF for print: its pages are the trim plus the bleed, with nothing else. On (the default), each page also has 5 mm beyond the bleed, with the crop marks in its corners (see Export).

json
"cropMarks": false

contents ​

Where the book's table of contents goes: "start", just before the first chapter (after a cover or a title page), or "end", after the last page of text. Without it there is no table, unless the text has a ::: {#contents} block, which gets the table wherever it is (see Markdown Conventions).

The table lists the chapters and two levels of sections inside each, with their page numbers, on pages of its own. Its title follows the book's language: "Contents" in English, "Índice" in Spanish.

json
"contents": "start"

files ​

  • content: the Markdown files of the book, in reading order.
  • assets: glob patterns for images and other files the text refers to.

style ​

Which style lays the book out. One of three forms:

FormMeaning
{ "preset": "novel" }One of Typoteka's styles, by id.
{ "path": "styles/mine" }A stylesheet in the book's own repository, at styles/mine/styles.css.
{ "repo": "owner/name", "ref": "main", "path": "styles/mine" }A stylesheet in another repository; ref is optional.

style.options ​

With a preset, options holds the style settings changed for this book:

json
"style": {
  "preset": "dnd5e",
  "options": { "pageSize": "A4", "bodySize": 10, "pageColour": "#FFFFFF" }
}

Each key is a setting the style declares; each style's page lists its keys, defaults and ranges. Values are numbers for sizes (in the unit the setting names) and strings for everything else. A value the style does not accept is ignored, and the editor says so in the status bar and the debug console.