Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Orchestration lives under [`scripts/`](scripts/) (`build.py`, per-format exporte
### Optional `book.yml`: diagrams and front matter

- **Diagram rasterization (`assets.diagrams`).** DOCX, PDF, and Kindle flows invoke [`tools/diagram_rasterize.py`](tools/diagram_rasterize.py) before Pandoc. Each publishable book lists **`assets.diagrams`** explicitly: optional **`entries`** (`svg`, `png`, optional `width`), optional **`default_width`**, and **`auto_discover`**. Use **`auto_discover: false`** with no **`entries`** when a book has no diagrams. When **`auto_discover`** is not false, any `docs/diagrams/*.svg` not already listed is rasterized to `export-assets/diagrams/<stem>.png`. If `book.yml` omits **`assets`** entirely (legacy trees), a small built-in catalog still seeds jobs when those SVG paths exist on disk.
- **Front matter generation (`frontmatter.generate`).** [`scripts/build.py`](scripts/build.py) calls [`scripts/frontmatter_gen.py`](scripts/frontmatter_gen.py) before each export when `frontmatter.generate.enabled` is true. Configure `title_page` and/or `copyright` blocks with `repo_template` (path relative to the repo, often under [`templates/`](templates/)) and `output` (path relative to the book folder). Templates are **[Jinja2](https://jinja.palletsprojects.com/)** (`.md.j2`): use `{{ title }}`, `{% if subtitle %}…{% endif %}`, `{% include "templates/partials/foo.md.j2" %}`, and other Jinja features. `template_context_from_book` in [`scripts/frontmatter_gen.py`](scripts/frontmatter_gen.py) supplies `title`, `subtitle`, `subtitle_line` (legacy spacing for older copyright templates), `author`, `year`, optional **`title_page_cover`** (path relative to `front-matter/title-page.md`, e.g. `../BookCover.png` for a cover file at the book root), **`title_page_footer`** (extra markdown after the byline), and **`title_page_newpage_after`** (boolean; inserts `\newpage` after the title block for PDF-style exports).
- **Front matter generation (`frontmatter.generate`).** [`scripts/build.py`](scripts/build.py) calls [`scripts/frontmatter_gen.py`](scripts/frontmatter_gen.py) before each export when `frontmatter.generate.enabled` is true. Configure `title_page` and/or `copyright` blocks with `repo_template` (path relative to the repo, often under [`templates/`](templates/)) and `output` (path relative to the book folder). Templates are **[Jinja2](https://jinja.palletsprojects.com/)** (`.md.j2`): use `{{ title }}`, `{% if subtitle %}…{% endif %}`, `{% include "templates/partials/foo.md.j2" %}`, and other Jinja features. `template_context_from_book` in [`scripts/frontmatter_gen.py`](scripts/frontmatter_gen.py) supplies `title`, `subtitle`, `subtitle_line` (legacy spacing for older copyright templates), `author`, `year`, optional **`title_page_cover`** (image reference for the title page; use a **basename** at the book root such as `BookCover.png` so Pandoc’s `--resource-path=<book_dir>` resolves it for DOCX/PDF—avoid `../…` paths, which Pandoc does not fetch correctly in multi-file builds), **`title_page_footer`** (extra markdown after the byline), and **`title_page_newpage_after`** (boolean; inserts `\newpage` after the title block for PDF-style exports).

The shape of these blocks is validated by [`schema/book.schema.json`](schema/book.schema.json); run `make validate-book-specs` after edits.

Expand Down
Binary file added books/coupling/BookCover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions books/coupling/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ book:
website: "https://after-certainty.com"
language: en
copyright_year: 2026
title_page_cover: BookCover.png

paths:
manuscript: "./index.md"
Expand All @@ -38,10 +39,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
4 changes: 4 additions & 0 deletions books/coupling/front-matter/title-page.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
![Cover](BookCover.png){ width=100% }

\newpage

# **Coupling**

## **Cohesion, Consequence, and the Architecture of Responsibility**
Expand Down
3 changes: 3 additions & 0 deletions books/curiosity-before-certainty/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
5 changes: 4 additions & 1 deletion books/how-meaning-moves/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ book:
website: "https://after-certainty.com"
language: en
copyright_year: 2026
title_page_cover: ../BookCover.png
title_page_cover: BookCover.png

paths:
manuscript: "./index.md"
Expand Down Expand Up @@ -44,10 +44,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
2 changes: 1 addition & 1 deletion books/how-meaning-moves/front-matter/title-page.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Cover](../BookCover.png){ width=100% }
![Cover](BookCover.png){ width=100% }

\newpage

Expand Down
3 changes: 3 additions & 0 deletions books/how-serious-systems-learn/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
5 changes: 4 additions & 1 deletion books/velorum/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ book:
website: "https://after-certainty.com"
language: en
copyright_year: 2026
title_page_cover: ../book_cover.png
title_page_cover: book_cover.png
title_page_footer: |
Author-facing planning and voice rules live under [`docs/`](../docs/); this page is for **exports** only.

Expand Down Expand Up @@ -41,10 +41,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
2 changes: 1 addition & 1 deletion books/velorum/front-matter/title-page.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Cover](../book_cover.png){ width=100% }
![Cover](book_cover.png){ width=100% }

\newpage

Expand Down
3 changes: 3 additions & 0 deletions books/when-authority-is-misread/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
3 changes: 3 additions & 0 deletions books/when-authority-outlives-accountability/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
3 changes: 3 additions & 0 deletions books/when-moral-seriousness-scales/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
5 changes: 4 additions & 1 deletion books/when-others-look-to-you/v1/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ book:
website: "https://after-certainty.com"
language: en
copyright_year: 2026
title_page_cover: ./BookCover.png
title_page_cover: BookCover.png
title_page_newpage_after: true

paths:
Expand Down Expand Up @@ -52,10 +52,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Cover](../BookCover.png){ width=100% }
![Cover](BookCover.png){ width=100% }

\newpage

Expand Down
5 changes: 4 additions & 1 deletion books/when-others-look-to-you/v2/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ book:
website: "https://after-certainty.com"
language: en
copyright_year: 2026
title_page_cover: ./BookCover.png
title_page_cover: BookCover.png
title_page_newpage_after: true

paths:
Expand Down Expand Up @@ -49,10 +49,13 @@ build:
enabled: true
epub:
enabled: true
pdf:
enabled: true

github:
release: true
release_tag: "latest"
artifacts:
- docx
- epub
- pdf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Cover](../BookCover.png){ width=100% }
![Cover](BookCover.png){ width=100% }

\newpage

Expand Down
8 changes: 4 additions & 4 deletions tools/generate_books_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def resolve_cover_path(repo: Path, spec_path: Path, spec: dict, cover_value: str
"""
Resolve `book.title_page_cover` to a repo-relative path for raw.githubusercontent URLs.

Paths like `../BookCover.png` are authored relative to the generated title page
(`frontmatter.generate.title_page.output`), not relative to `book.yml`. Pandoc
resolves images from that markdown file's directory; match that here so URLs
point at the real asset under the book folder.
Values are usually basenames (e.g. `BookCover.png`) at the book root; resolution
tries the title-page output directory first, then the book directory, so manifest
URLs match the on-disk asset. Pandoc exports pass `--resource-path=<book_dir>`,
which resolves those basenames for DOCX/PDF.
"""
book_dir = spec_path.parent.resolve()
anchors: list[Path] = []
Expand Down
Loading