Repository navigation
Preview a whole chapter, from any build - #272
Merged
Merged
Conversation
npm run preview -- <name> --chapter <file name or title> renders every page of one chapter, and --pdf <file> reads a build other than the digital edition. The build writes a page map beside each PDF giving each chapter's first and last page, so a chapter preview shows the book's own pages, broken where the build breaks them. Docs brought in line with the code: CLAUDE.md described preview's first argument as a chapter and said the build printed only the output path; the cover example in PRINT-SPECIFICATION.md used an old page count; and resize-cover's --out and the macOS Chromium fallback were undocumented. The preview now falls back to Homebrew's Chromium as the build does. Claude-Session: https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
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.
npm run previewcould only render the single page carrying a phrase, from the digital edition. It now also renders a whole chapter, and can read any build.<pdf name>.pages.jsonbeside each PDF, giving each chapter's file, title, and first and last page as laid out. A chapter preview therefore shows the book's own pages, broken where that build breaks them, without rebuilding the chapter on its own.--chaptermatches on file name or title, case-insensitively. A query that matches several chapters lists them and exits, unless it is exactly one chapter's file name (intropicksintro.mdoverintroduction.md).Docs brought in line with the code
CLAUDE.mdPRINT-SPECIFICATION.mdresize-cover --out, the page map, the new preview options, and the full Chromium lookup order.README.md: the Chromium lookup order, and a pointer tonpm run preview.Verified
npm run lint,node scripts/check-figure-geometry.mjsandnpm run build-pdf-digitalpass.--chapter ammlists the two AMM chapters.🤖 Generated with Claude Code
https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
Generated by Claude Code