Write in markdown. Build a branded PDF and a dual-theme HTML page. One config file.
uvx ebook-engine init
uvx ebook-engine build .Live demo · Buy — $29 one-time · Source
Takes a directory of markdown (or HTML) files and produces:
- PDF — cover page, table of contents, running headers, syntax-highlighted code
- HTML — single-page web reader with a light/dark theme toggle, SEO meta tags, responsive layout
Everything is configured in one ebook.toml file. No templating language. No JavaScript framework. No frontmatter required.
Requires Python 3.11+. Pick one:
# uv (recommended) — run without installing
uvx ebook-engine --help
# uv — install as a persistent tool
uv tool install ebook-engine
# pip
pip install ebook-engineFor PDF output, install weasyprint — the engine finds it on PATH:
brew install weasyprint # macOS
apt install weasyprint # Debian/Ubuntumkdir my-book && cd my-book
ebook-engine init
echo "# Chapter 1
This is the first chapter." > 01-intro.md
ebook-engine build .
# → dist/my-book.pdf (cover + TOC + chapters)
# → dist/index.html (dual-theme web page)The build auto-detects the source type: .md files are treated as markdown chapters, .html files as HTML intake (exported from Notion, Affine, and similar tools — export artifacts like duplicate titles and workspace backlinks are stripped automatically).
ebook-engine init writes this ebook.toml:
[book]
title = "My Book"
subtitle = "A practical guide"
author = "Author Name"
description = "A description for meta tags and SEO."
keywords = ["topic", "guide"]
[brand]
accent = "#00E5FF" # used for links, headings, borders
font = '"Space Mono", ui-monospace, Menlo, monospace'
footer = "grid[lab]" # shown at the bottom of every page
[output]
directory = "dist"
pdf = true # requires weasyprint
html = true # dual-theme light/dark page
[analytics]
vercel = false # inject Vercel Analytics (works on Vercel deploys)
google = "" # Google Analytics measurement ID (e.g. "G-XXXXXXXXXX")
matomo_url = ""
matomo_site_id = ""- Dual-theme HTML — light reader mode and dark branded mode, persisted in localStorage
- Configurable branding — accent color, font stack, footer text, all in
ebook.toml - SEO-ready — canonical URL, robots meta, description, keywords
- Analytics injection — Vercel, Google Analytics, or Matomo
- PDF with print CSS — running headers, page numbers, cover page, table of contents
- HTML intake cleaner — strips export artifacts from Notion, Affine, and similar tools
- Markdown with Obsidian support — wikilinks, image embeds, callouts, YAML frontmatter
- Safe by default — config values are HTML-escaped; the output directory is validated against path traversal
This is a build tool, not a content management system. You write in files. You run a command. You get output artifacts. There's no database, no admin panel, no login. The source of truth is your git repo.
If you want a WYSIWYG editor with real-time collaboration, use Notion or Google Docs — then export to HTML and feed it to the engine.
Full guides live in docs/: getting started, configuration, CLI reference, examples.
MIT. Source: github.com/IsaacBell/ebook-engine. The $29 purchase supports development and gives you priority support. The engine is fully functional without a license key.