-
Notifications
You must be signed in to change notification settings - Fork 0
PDF generation
How to produce a print-ready PDF of the bylaws from BYLAWS.md.
-
Node.js with
npm installcompleted in the repo root -
Pandoc installed as a system dependency
(installation docs):
- Debian/Ubuntu:
sudo apt install pandoc - macOS:
brew install pandoc
- Debian/Ubuntu:
PDF generation is a two-step pipeline:
npm run build:html:standaloneThis runs Pandoc to convert BYLAWS.md into a self-contained HTML file at
dist/bylaws-standalone.html, embedding the print stylesheet
(scripts/bylaws-print.css) and the TeX Gyre Schola font files directly into
the document.
npm run build:pdfThis runs pagedjs-cli (installed via npm) on the standalone HTML to produce
dist/bylaws.pdf. The PDF uses US Letter page size with running headers
(foundation name on the left, current article title on the right) and page
numbers in the footer.
Note:
build:pdfrequires the standalone HTML to exist first. Always runbuild:html:standalonebeforebuild:pdf.
| File | Description |
|---|---|
dist/bylaws-standalone.html |
Self-contained HTML with embedded CSS |
dist/bylaws.pdf |
Print-ready PDF (US Letter) |
When a version tag is pushed and CI governance checks pass, the Deploy Bylaws to WordPress workflow automatically:
- Builds the standalone HTML and PDF
- Creates a GitHub Release attaching both
dist/bylaws-standalone.htmlanddist/bylaws.pdf
No manual PDF generation is needed for official releases.
The PDF styling is defined in scripts/bylaws-print.css. Key features:
-
Font: TeX Gyre Schola (a Century Schoolbook derivative, bundled in
fonts/tex-gyre-schola/) - Page size: US Letter with 1" top/bottom and 1.25" left/right margins
- Running headers: Foundation name (top-left), current article title (top-right), suppressed on the first page
- Footer: "Page X of Y" centered
- Flow control: Headings avoid breaking after, list items avoid breaking inside, orphans/widows set to 3