Add KDP cover PDF generator

scripts/cover.js computes the exact cover canvas dimensions from the
page count in book-meta.json (written by build.js), using the KDP
Premium Color spine formula (0.002347 in/page), and renders a
Nunjucks template to a single PDF containing back cover, spine, and
front cover with bleed (0.125 in) and safe-zone overlay guides.

- `pnpm cover`  — generate output/cover.pdf
- `pnpm all`    — build interior + both PDFs in one command
- Cover artwork slots: images/cover/front.png, images/cover/back.png

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-03 17:29:10 +02:00
parent ae82edac2c
commit 1037b84eaa
6 changed files with 552 additions and 3 deletions
+2
View File
@@ -6,7 +6,9 @@
"scripts": {
"build": "node scripts/build.js",
"pdf": "node scripts/pdf.js",
"cover": "node scripts/cover.js",
"book": "pnpm build && pnpm pdf",
"all": "pnpm build && pnpm pdf && pnpm cover",
"watch": "node --watch scripts/build.js"
},
"pnpm": {