Convert markdown, plain text, or a whole directory of content into a Kindle-friendly EPUB.
Clone and link globally:
git clone https://github.com/dereksmart/bookbind.git
cd bookbind
npm install
npm linkRequires Node 18+.
Single file:
bookbind notes.md
bookbind draft.md -o my-book.epub -t "My Book" -a "Derek Smart"Directory (recursively walked, files sorted naturally, hidden files skipped):
bookbind ./chapters -t "The Collected Notes" -a "Derek Smart" -c cover.jpg| Flag | Description |
|---|---|
-o, --output <file> |
Output .epub path (default: <input>.epub) |
-t, --title <title> |
Book title (default: derived from input name) |
-a, --author <author> |
Author name (default: Unknown) |
-c, --cover <image> |
Cover image path |
--lang <lang> |
Language code (default: en) |
--description <desc> |
Book description |
--no-split |
Keep a single markdown file as one chapter |
--split-on <level> |
Heading level for chapter splitting (1-6, default: 2) |
A single markdown file with multiple ## headings is auto-split into chapters — each ## heading becomes a navigable chapter on Kindle. The first # Heading in the file is used as the book title (overridden by -t). Content before the first ## is prepended to the first chapter.
For directories, each file is a chapter; splitting inside files is off.
- Supported text:
.md,.markdown,.txt - Each file becomes a chapter; the filename (minus leading numbers/punctuation, with
-/_spaced out) becomes the chapter title - Images referenced by relative path in markdown are resolved against the file's directory and embedded
.txtis escaped and split into paragraphs on blank lines
Email the resulting .epub to your Send-to-Kindle address, or drop it on the device over USB. Amazon accepts EPUB directly now.
MIT