diff --git a/docs/print/STANDING_ORDER.pdf b/docs/print/STANDING_ORDER.pdf index 2f73bf5..19f1c54 100644 Binary files a/docs/print/STANDING_ORDER.pdf and b/docs/print/STANDING_ORDER.pdf differ diff --git a/tools/make-pdf.mjs b/tools/make-pdf.mjs index 1aaf17c..61193e4 100644 --- a/tools/make-pdf.mjs +++ b/tools/make-pdf.mjs @@ -13,6 +13,10 @@ * headless print is a real renderer with real page rules, so that is the engine. * * node tools/make-pdf.mjs docs/scenarios/STANDING_ORDER.md [--out ] [--keep-html] + * + * --compact drops the page break before each section. A scenario wants one section per page, + * because a GM turns to a section and reads it; a two-page update note does not, and giving + * it one printed eight pages with a paragraph on each. */ import { readFileSync, readdirSync, writeFileSync, existsSync, mkdirSync } from "node:fs"; import { execFileSync } from "node:child_process"; @@ -22,6 +26,7 @@ const ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace const argv = process.argv.slice(2); const SRC = argv.find(a => !a.startsWith("--")); if (!SRC) { console.error("usage: node tools/make-pdf.mjs [--out file.pdf]"); process.exit(1); } +const COMPACT = argv.includes("--compact"); const outArg = argv.indexOf("--out"); const OUT = path.resolve(ROOT, outArg > -1 ? argv[outArg + 1] : path.join("docs", "print", path.basename(SRC).replace(/\.md$/, ".pdf"))); @@ -147,8 +152,9 @@ body { margin: 0; line-height: 1.45; } h1, h2, h3, h4 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.2; } h1 { display: none; } /* the cover carries the title */ h2 { font-size: 15pt; letter-spacing: .04em; text-transform: uppercase; - border-bottom: 2pt solid #7a1f1f; padding-bottom: 2mm; margin: 0 0 4mm; - break-before: page; break-after: avoid; } + border-bottom: 2pt solid #7a1f1f; padding-bottom: 2mm; margin: ${COMPACT ? "7mm 0 4mm" : "0 0 4mm"}; + ${COMPACT ? "" : "break-before: page;"} break-after: avoid; } +h2:first-of-type { margin-top: 0; } h3 { font-size: 12pt; margin: 6mm 0 2mm; break-after: avoid; } h4 { font-size: 10.5pt; margin: 4mm 0 1mm; break-after: avoid; } p { margin: 0 0 2.4mm; orphans: 3; widows: 3; }