Repository navigation
Rebuild the EPUB and PDF downloads every time the book changes - #131
Draft
robertbpugh wants to merge 4 commits into
Draft
robertbpugh wants to merge 4 commits into
robertbpugh wants to merge 4 commits into
Conversation
Found while building the ebooks: - WordPress Incorporated pointed its spam screenshot at the old WordPress/book repo path, which now returns 404. - Building Blocks chapter 4 linked to "automattic.com" with no https://, which resolves as a relative path. - An image in Happy Cog Redesign had its width in curly quotes, and one in Habari was not self-closed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXBwXzdG2XPckiBuLKiFZ1
bin/build-books.py builds both volumes with pandoc, in the order manifest.json lists the chapters, and the PDF goes through WeasyPrint so the book's HTML images and links survive. The Build books workflow runs it on pull requests (with epubcheck) and, on trunk, publishes the files to a "latest" release. The README links there; the designed original editions stay in Formats/. The Volume 2 cover comes from its original EPUB. Closes #122. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXBwXzdG2XPckiBuLKiFZ1
- Premium Themes had curly quotes around an alt attribute, and Problem with Post Formats was missing alt= before its text, so both images showed as raw HTML. - Building Blocks chapters 5 and 8 used ## for sections, the same level as the chapter title, where every other chapter (and the live site) uses ###. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXBwXzdG2XPckiBuLKiFZ1
…ases - Leave the Introduction's section headings at ## so the outline doesn't skip a level and they stay in the table of contents. - Normalize width and height px values independently. - Never publish an older build over a newer one when a run is re-run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXBwXzdG2XPckiBuLKiFZ1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The EPUB and PDF downloads now rebuild every time the book changes, so readers stop getting the 2015 and 2023 text with every later fix missing.
Today the downloads are hand-made files that nothing updates, and #122 asked for a release with proper download links. This adds both.
What it does
bin/build-books.pybuilds an EPUB and a PDF of each volume with pandoc, reading chapters in the ordermanifest.jsonlists them, so chapter 10 doesn't sort before chapter 2. Volume 1 gets its Part headings, both volumes get their original covers, and each chapter keeps its own footnotes.The PDF goes through WeasyPrint instead of pandoc's default LaTeX route. That route quietly drops raw HTML, and these chapters use HTML for most of their images and many links.
The Build books workflow runs it on every pull request that touches the book and checks both EPUBs with epubcheck. On trunk it also publishes the four files to a release tagged
latest, so these links always serve the current text:They'll work once this merges and the first build publishes. The README points there now. The designed original editions stay in
Formats/with a note that they don't include later fixes. MOBI isn't built, since Kindle reads EPUB directly.Fixes the build turned up
epubcheck and a test build found four real problems in the chapters, fixed in a separate commit:
automattic.comwithouthttps://, so the link went nowhere.Testing
I ran the build in an Ubuntu 24.04 container with the same apt packages the workflow installs (pandoc 3.1.3, WeasyPrint 61.1, epubcheck):
This is stacked on #130, so it includes #129 and #130 until they merge.
Closes #122.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MXBwXzdG2XPckiBuLKiFZ1