Skip to content

One document per section

Generate several books: the whole guide without its home page, and a document for each section of the navigation.

The table of contents of the whole guide

pdf/field-guide.pdf

plugins:
  - exporter:
      formats:
        pdf:
          footer:
            center: "Page {page} of {pages}"
          books:
            - output: pdf/field-guide.pdf
              exclude:
                - index.md
              toc:
                enabled: true
            - output: pdf/guide.pdf
              include:
                - guide/*
              metadata:
                title: Field Guide - Guide
            - output: pdf/reference.pdf
              include:
                - reference/*
              metadata:
                title: Field Guide - Reference
site/
├── pdf/
│   ├── field-guide.pdf   # Every page but the home page
│   ├── guide.pdf         # guide/writing.md and guide/printing.md
│   └── reference.pdf     # reference/paper-sizes.md and reference/glossary.md
├── guide/
│   ├── writing/
│   │   ├── index.html
│   │   └── index.pdf
│   └── ...
└── ...
  • books lists books, each with its own options (covers, table of contents, bookmarks...).
  • include and exclude select pages by the path of their source file, relative to the docs directory: * matches any text, including /. Pages are in the order of the navigation.
  • Each document is numbered on its own: {pages} counts the pages of the document.
  • metadata sets the information shown by PDF readers, the title being the website's name by default.

Browse the files of this example