Editions
Every build writes to dist/<config name>/ under the current folder (dist/book/ for book.json), or to --out <dir>:
| File | Built by |
|---|---|
<output_name>-170x240.pdf | build pdf |
<output_name>-170x240-printed.pdf | build pdf --printed |
<output_name>.epub | build epub |
web/ | build web, serve |
QA-REPORT.md, qa-pages/ | qa |
src/ | working files kept for checking |
PDF
$ md2book build pdf
$ md2book build pdf --printedThe 170 × 240 mm book, in this order: cover, title page, copyright page, contents with page numbers, then the chapters, with running headers and page numbers.
- Page 1 is the first page of chapter one. Myanmar books number pages in Myanmar digits (
chapter_digits). recto_chapter_start: truestarts every chapter on a right-hand page;running_headers: falseremoves the page headers.- Burmese lines break between syllables, never inside one.
- A section heading never sits alone at the foot of a page; it moves to the next page with its first lines.
- An
end_imagebecomes the last page once the chapter named byend_image_afterexists.
Printed edition. --printed writes the print-shop interior, <output_name>-170x240-printed.pdf: no cover page (the title page is page 1), no colour and no dark fills, so code and terminal blocks print cleanly in black and white.
The HTML the PDF is typeset from is kept in src/book-print.html (or src/book-printed.html) for checking.
EPUB
$ md2book build epubA reflowable EPUB 3 of every chapter, <output_name>.epub, with the book's fonts embedded, the cover, a title and copyright page, and the contents. An end_image is the last document once the chapter named by end_image_after exists. The unpacked files stay in src/epub/.
Web edition
$ md2book build web
$ md2book serve --port 8000A static site of the chapters listed in web_published_chapters; other chapter files are never read, so unpublished drafts never reach the site. It reads like a real book: it opens from a closed cover, pages turn with a curled sheet, and wide screens show a two-page spread.
Readers get a toolbar with the contents, search, text size, bookmarks and fullscreen, and these keys:
| Key | Action |
|---|---|
← → | previous and next page |
+ - | larger and smaller text (code blocks keep their size) |
F | fullscreen |
The reading position, bookmarks and text size are remembered in the browser.
The site is written to web/: index.html, one page per chapter in chapters/, 404.html, and its styles, fonts and images. Upload the folder as it is; it must be served from the root of its domain.
| Key | Effect |
|---|---|
web_url | canonical and share links |
description | the page description (default subtitle, then title) |
favicon | an SVG icon |
back_cover | the back cover; without it a plain one is generated with Chromium |
serve builds the site, then serves it at http://127.0.0.1:8000/ (--port changes the port) until Ctrl+C.
QA report
$ md2book qa
$ md2book qa --printedQA-REPORT.md is a checklist to read before publishing. qa reports problems and never changes your files. It covers:
- Manuscript: chapter count and order, code includes, word and character counts, and a table of chapters with their sections.
- Unicode and Burmese text: text that is not NFC-normalized, replacement characters, zero-width and no-break spaces, BOMs, control characters, doubled vowel or medial signs, doubled punctuation, a space before
။or၊, double spaces, repeated words and HTML tags, with file and line. - Typeface coverage: which characters each font draws, and any character none of the book's fonts cover.
- PDF (when built): page facts and checks, with sample pages rendered to
qa-pages/.--printedchecks the printed PDF. - EPUB (when built): reflowable layout, embedded fonts, chapter text identical to the manuscript, structure, and the epubcheck result when it is on your
PATH. - Metadata placeholders: book fields that still contain
PLACEHOLDER. - Known layout limitations and a section for your own review notes.
qa checks the PDF and EPUB already in the output folder; run the builds first, or use build all, which builds everything and then writes the report.