Docs that build themselves with Grimoire

Jennifer

A folder of Markdown in, a searchable website, a printed book and an EPUB out, rebuilt by CI on every release.

November 2026, by @mplx.
Based on Jennifer 0.26.0 and Grimoire 0.5.0

Powered by Jennifer's Cantrip - Markdown into slide decks, https://github.com/jennifer-language/cantrip
1 / 18

What Grimoire does

2 / 18

Install it, or don't

jvc app install https://github.com/jennifer-language/grimoire
grimoire --version            # grimoire 0.5.0

Or no install at all, only a container runtime:

docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/work" \
    ghcr.io/jennifer-language/grimoire:0.5.0 build --pdf

Needs Jennifer 0.26.0 or newer; serve needs the default binary.

3 / 18

A book in a minute

$ grimoire init my-book
initialising a Grimoire book in my-book/
  wrote   my-book/grimoire.toml
  wrote   my-book/docs/SUMMARY.md
  wrote   my-book/docs/index.md
  wrote   my-book/docs/getting-started/installation.md
  wrote   my-book/docs/getting-started/first-steps.md

$ cd my-book && grimoire build --pdf
built 3 pages into site/ (74 KiB, 0 assets) in 35 ms
  search index: 3 sections
  pdf: site/my-book.pdf (4 KiB)
4 / 18

The outline: SUMMARY.md

# Summary

[Introduction](index.md)

# Getting started

- [Installation](getting-started/installation.md)
- [First steps](getting-started/first-steps.md)
5 / 18

grimoire.toml: what most books set

[book]
title = "My Book"
src = "docs"

[html]
theme = "nordic"            # grimoire themes lists all eleven
editUrl = "https://github.com/me/book/edit/main/docs/{path}"

[highlight]
enabled = true              # Jennifer code coloured at build time

[pdf]
pageNumbers = true
6 / 18

Eleven themes, each light and dark

The nordic theme, light and dark

carbon ember grimoire ivy meridian nordic obsidian orchid sepia sixtyfour terminal

7 / 18

The printed book

[pdf]
paper = "a4"                # or "letter"
pageNumbers = true          # page/total in the footer
footerLeft = "My Book {version} {commit}"
bookmarkLevel = 3
exclude = ["api/", "technical/coverage.md"]
8 / 18

The e-book: EPUB

[renderer.epub]
output = "my-book.epub"
cover = "assets/cover.png"      # optional
stylesheet = "assets/epub.css"  # optional, a default is built in
$ grimoire build --pdf --verbose
  plugin  renderer epub  ->  .../grimoire-epub
  render  epub  ->  my-book.epub
9 / 18

Several books from one docs/ tree

The Jennifer repository builds two PDFs from docs/:

# grimoire.toml: the manual, without the API pages
[pdf]
exclude = ["api/", "technical/coverage.md"]
# grimoire-api.toml: only the API pages, as their own book
[book]
title = "Jennifer Module API Reference"
src = "docs/api"
grimoire pdf -c grimoire-api.toml --out docs/api
10 / 18

Tried on our book

$ grimoire build --pdf --verbose
  ...
  skipped reference/index.md (excluded from the PDF)
  skipped reference/options.md (excluded from the PDF)
  assets  stylesheet, runtime, search index, llms.txt
  copied  0 files from docs
built 5 pages into site/ (88 KiB, 0 assets) in 63 ms
  search index: 6 sections
  pdf: site/my-book.pdf (4 KiB)

$ grimoire pdf -c grimoire-ref.toml
rendered site/my-book-reference.pdf (2 KiB) in 12 ms
11 / 18

Plugins are programs

[preprocessor.include]

[renderer.sitemap]
baseUrl = "https://docs.example.org/"
```jennifer
{{#include examples/hello.j}}
```
12 / 18

Know what a book will run

$ grimoire plugins
Programs this book runs, from grimoire.toml:

  preprocessor  include  ->  .../grimoire-include  (ships with Grimoire)
  renderer      sitemap  ->  .../grimoire-sitemap  (ships with Grimoire)

Each one runs with your permissions and can do anything you can.
Nothing is discovered: every program above is named in the file.
13 / 18

Writing your own plugin

14 / 18

The container image

# preview with live reload
docker run --rm --user "$(id -u):$(id -g)" -p 8080:8080 \
    -v "$PWD:/work" ghcr.io/jennifer-language/grimoire:0.5.0 \
    serve --watch --addr 0.0.0.0:8080
TagIs
0.5.0one release, never changes
0.5newest release of that line
latestthe highest release
devthe tip of the default branch
15 / 18

CI: publish from the latest release

on:
  push:
    tags: ["[0-9]+.[0-9]+.[0-9]+"]
  pull_request:
jobs:
  pages:
    permissions: { contents: read, pages: write, id-token: write }
    uses: jennifer-language/grimoire/.github/workflows/docs-pages.yml@0.5.0
    with:
      image: ghcr.io/jennifer-language/grimoire:0.5.0
      args: --pdf
16 / 18

Pages that write themselves: prepare and check

prepare: |
  go build -o jennifer ./cmd/jennifer
  ./jennifer run scripts/gen-module-docs.j
  docker run --rm --user "$(id -u):$(id -g)" \
    -v "$PWD:/work" -w /work \
    "$IMAGE" pdf -c grimoire-api.toml --out /work/docs/api
check: |
  test -s "$SITE/jennifer-manual.pdf"
  test -s "$SITE/api/jennifer-module-api.pdf"
17 / 18

Read more

Based on Jennifer 0.26.0, November 2026.

18 / 18