Pamphlet library
Pamphlet-preview Β· biz/pamphlet-preview/README.md

Pamphlet library

Versioned source for danielslater.dev services & pricing pamphlets β€” the A4 documents sent to prospects and clients. One data file drives every variant; a static build renders standalone pages plus a mobile-friendly review gallery.

⚠️ Contains client/prospect names and pricing strategy. Keep it local or in a private remote only β€” never a public repo.

Layout

Path What
data.mjs Content for every pamphlet variant (the one file you edit).
build.mjs Pure renderer β†’ writes pamphlet.css, p/<id>.html, and index.html (the gallery). No browser needed.
render-check.mjs Headless Chromium β€” asserts no page overflows its A4 box; optional per-page screenshots.
thumbs.mjs Headless Chromium β€” cover thumbnails into thumbs/ for the gallery cards.
p/ Generated standalone pamphlets (one HTML per variant).
assets/ Real site screenshots used inside pamphlets (before/after, covers).
thumbs/ Generated cover thumbnails for the gallery.
index.html Generated gallery β€” grouped, versioned, mobile-first.

Workflow

node build.mjs          # regenerate pamphlet.css + p/*.html + index.html
node thumbs.mjs         # regenerate cover thumbnails (all variants)
node thumbs.mjs low     # …or just one
node render-check.mjs               # A4 overflow check (all)
SHOTS=/tmp/out node render-check.mjs therapists   # + per-page screenshots

Playwright is borrowed from ../../aerias-demo/node_modules (absolute import in render-check.mjs / thumbs.mjs).

View it

python3 -m http.server 5300 --directory .
# desktop:  http://localhost:5300/index.html
# on a phone (same Wi-Fi):  http://<your-LAN-ip>:5300/index.html

Pamphlet pages carry <meta name="viewport" content="width=794"> so the fixed A4 layout scales to fit a phone (like viewing a PDF). The gallery itself is responsive device-width.

Adding a variant

  1. Add a const X = { id, group, label, nav, version, updated, blurb, pages:[…] } object in data.mjs, built from the B.* block renderers (see THERAPISTS for the fullest example).
  2. Append it to the export const pamphlets = [...] array.
  3. group drives the gallery section β€” vertical Β· tier Β· client Β· option (any new group name gets its own section automatically).
  4. node build.mjs && node thumbs.mjs X && node render-check.mjs X.

Versioning

Each variant carries version + updated, shown on its gallery card. Change history lives in CHANGELOG.md and git.