diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b94443e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Build intermediates. The deliverables (.epub, .pdf, cover .png) are committed. +build/*/body.html +build/*/media/ + +node_modules +package-lock.json diff --git a/BUILDEBOOK.md b/BUILDEBOOK.md new file mode 100644 index 0000000..ea68c2d --- /dev/null +++ b/BUILDEBOOK.md @@ -0,0 +1,113 @@ +# Build brief — turn these HTML books into sellable ebooks + +Hand this whole file to Claude Code, in the folder that contains the source files. + +--- + +## Project + +Two editions of the same novel, plus a cover generator. + +| File | What it is | +|---|---| +| `faramushkhaneh.html` | Persian edition — «مردی که دخترش را فراموش کرد» | +| `the-man-who-forgot-his-daughter.html` | English edition — *The Man Who Forgot His Daughter* | +| `cover.html` | Cover generator (canvas, exports 1600×2560 PNG, FA/EN toggle) | + +**Author (both editions):** محمدپرهام پلنگ سنگدوینی / Mohammadparham Palangsangdovini + +**Deliverables:** for each language — a validated EPUB 3, a print-ready PDF, and a cover PNG. + +--- + +## Task 1 — Covers + +Open `cover.html` in a headless browser (Playwright is fine). Wait for +`document.fonts.ready` before capturing, or the Persian text will render as boxes. + +Export four PNGs by clicking the language toggle and the full-size download: + +- `cover-fa.png` — 1600×2560 +- `cover-en.png` — 1600×2560 +- plus 600×960 web versions of each for store listings + +Verify each PNG is exactly 1600×2560 and under 50 MB (Amazon's ceiling). + +--- + +## Task 2 — EPUB + +Use pandoc. Two things matter more than anything else here: + +### Persian EPUB — the part that usually breaks + +Persian will not render on Kindle, Kobo, or Apple Books unless the font is +**embedded inside the EPUB**. Do this: + +1. Download a Persian-capable font with an open licence (Vazirmatn or Noto Naskh Arabic). +2. Embed it via `--epub-embed-font`. +3. Set RTL in the CSS: `body { direction: rtl; text-align: justify; }` +4. Set `page-progression-direction="rtl"` in the OPF spine. Pandoc will not do this + itself — unzip the EPUB, patch `content.opf`, rezip with `mimetype` stored + uncompressed and first in the archive, or the file will be rejected. + +### Metadata + +Read the author from `` in each HTML file. Build an +`epub-metadata.yaml` per language with: title, author, language (`fa` / `en`), +publisher, rights, and a UUID identifier. Give each language its **own** UUID — +they are two different books in every store. + +### Structure + +The HTML uses `