Publication File

The publication file can be a .json or a .yaml file that contains information about how a set of files are generated. It includes editions which control the different output formats (PDF, EPUB) or allow for different variants of the book (such as for different stores or a patron's version). A simple publication looks like:

metadata:
  language: en
  author: D. Moonfire
  title: Example

  theme: "@mfgames-writing/clean-theme"
  outputDirectory: .
  outputFilename: "{{ edition.name }}-{{ edition.version }}.{{ edition.ext }}"

editions:
  epub:
    format: "@mfgames-writing/epub2-format"
    ext: epub

  pdf:
    format: "@mfgames-writing/weasyprint-format"
    ext: pdf

contents:
  - element: cover
    source: covers/front.jpg
    linear: false
    exclude:
      editions: [pdf]
      toc: true
  - element: title
    source: title.html
    linear: false
    exclude:
      toc: true
  - element: chapter
    directory: chapters
    source: /^chapter-\d+.md$/
    start: true
    page: 1
  - element: appendix
    source: matter/about.md

Editions

Editions are used for a number of purposes, mostly to control different output formats of the document such as an HTML, EPUB2, or PDF document. It can also be used to conditionally include or exclude individual elements.

Elements

Elements are the components that make up the contents of a document. They can represent a Markdown file, an HTML page with a title, or a cover image.

Metadata

Project