Zero-dependency book builder for children's early readers. Outputs a single scrollable HTML page → print/save as PDF.
git clone [email protected]:kkwangsir/book-template.git my-book
cd my-book/template
# 1. Put images in images/ (1024×1536 JPG)
# 2. Edit book.json with your story
# 3. Build
node ../build.js .
# Output: docs/index.html — open in browser → Ctrl+P → Save as PDF
Cover → Vocabulary → Story pages → Questions → Answer Key
Cover → Ch1 Title → Vocab → Pages → Ch2 Title → Vocab → Pages → ... → All Questions → All Answers
node ../build.js . --chapter 1 # → docs/chapter-01.html
node ../build.js . --chapter 2 # → docs/chapter-02.html
Each chapter gets its own vocabulary and title page. Questions accumulate across chapters and appear at the end.
# Full book PDF
weasyprint docs/index.html "My Book.pdf"
# Single chapter PDF
weasyprint docs/chapter-01.html "Chapter 1.pdf"
# Or just open the HTML in Chrome → Ctrl+P → Save as PDF
my-book/
├── images/ # page_01.jpg, ch01_01.jpg, etc.
├── book.json # Story data (pages[] or chapters[])
└── build.js # Build script (from parent dir)
See template/book.json for a full example.
Two modes:
Simple (pages[]):
{
"pages": [...],
"vocabulary": [...],
"questions": [...]
}
Chapter book (chapters[]):
{
"chapters": [
{
"title": "Chapter Name",
"subtitle": "Optional subtitle",
"pages": [...],
"vocabulary": [...],
"questions": [...]
}
]
}
node build.js, no npm installpip install weasyprint for server-side PDF@page{size:Letter;margin:0}