Skip to content

Add build-pdf-website-preview: the free sample for the website - #274

Merged
mikemaccana merged 2 commits into
mainfrom
claude/lucid-fermat-645a3d
Oct 6, 2026
Merged

mikemaccana merged 2 commits into
mainfrom
claude/lucid-fermat-645a3d

Conversation

@mikemaccana

@mikemaccana mikemaccana commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Adds npm run build-pdf-website-preview, which builds the digital edition and cuts from it the free sample offered on the website: every page before the Part I title page (the cover, front matter, contents and the Introduction, 24 pages today), then a closing page inviting the reader to give their email address for the whole book.

Changes

  • New script scripts/build-website-preview.mjs:

    • Reads the digital edition PDF and its page map
    • Finds the Part I title page by its text, searching from the Introduction's last page, so the cut moves with the front matter
    • Copies every page before it into a new document (1.5 MB, against 15 MB for the whole book)
    • Prints the closing page in Chromium at the book's trim, centered both ways, in the book's faces (Denim INK heading, Gelasio text), and appends it on a right-hand page
    • Keeps the named destinations and links that point at kept pages, and drops the contents and cross-reference links to pages the sample leaves out
    • Writes build/Building Financial Software on Solana (website preview).pdf; the title a reader's viewer shows is "(preview)"
  • package.json: the build-pdf-website-preview script, which runs build-pdf-digital first

  • README.md, PRINT-SPECIFICATION.md: the new command

Verification

npm run lint, node scripts/check-figure-geometry.mjs and npm run build-pdf-website-preview (which runs the full digital build) all pass. The closing page was checked by rendering it with npm run preview.

🤖 Generated with Claude Code

https://claude.ai/code/session_0135186xHwGnGQgC4WZb62C4

Mike MacCana added 2 commits October 6, 2026 20:22
Builds the digital edition, keeps every page before the Part I title page,
and appends a closing page inviting the reader to ask for the whole book by
email. Links to pages the sample leaves out are removed.

Claude-Session: https://claude.ai/code/session_0135186xHwGnGQgC4WZb62C4
Says where the file is for. The output is now
build/Building Financial Software on Solana (website preview).pdf; the title a
reader's viewer shows stays "(preview)".

Claude-Session: https://claude.ai/code/session_0135186xHwGnGQgC4WZb62C4
@mikemaccana mikemaccana changed the title Add free preview PDF generation from digital edition Add build-pdf-website-preview: the free sample for the website Oct 6, 2026
@mikemaccana
mikemaccana merged commit 3b4bf21 into main Oct 6, 2026
1 check passed
@mikemaccana
mikemaccana deleted the claude/lucid-fermat-645a3d branch October 13, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant