README · README.md
Obsidian Markdown to Ebook Pipeline
This container watches a mounted markdown share for story folders and generates DOCX, EPUB, and MOBI files into a separate mounted output folder.
How it works
- The container scans the mounted vault under
/vault/<CREATIVE_FOLDER>. - Each story folder is identified by a
metadata.mdfile with YAML frontmatter. - If that frontmatter contains
export: true, the container merges the sibling chapter.mdfiles in that folder and exports a DOCX withpandoc, using a custom reference document so headings are black and the document uses Times New Roman instead of the default Office theme. - That DOCX is then converted into EPUB and MOBI with Calibre's
ebook-convert. - The finished files are written to
/output, with.docxin the root plus/output/epuband/output/mobisubfolders for the other formats. All generated files are set to mode0644so they are readable by all users. - The container resets
export: falsein the story'smetadata.md.
Story layout
Only markdown files directly inside the story folder are treated as chapters. Subfolders are ignored.
Creative/
Novel Name/
metadata.md
Chapter 1 - Opening.md
Chapter 2 - Next Scene.md
cover.jpg
Example metadata.md:
---
title: "Novel Name"
author: "Your Name"
language: en
export: false
# cover: cover.jpg
---
Run with Docker Compose
Update docker-compose.yml to point at your real folders, then run:
docker compose up -d --build
Watch logs with:
docker compose logs -f
Environment
| Variable | Default | Description |
|---|---|---|
CREATIVE_FOLDER | Creative | Subfolder under /vault to scan |
POLL_INTERVAL | 10 | Seconds between scans |
LOG_LEVEL | INFO | Python logging level |
VAULT_PATH | /vault | Mounted source folder |
OUTPUT_DIR | /output | Mounted output folder |
LUA_FILTER_PATH | /app/center-v.lua | Pandoc Lua filter |
CSS_FILE_PATH | /app/epub-style.css | Extra stylesheet used during EPUB and MOBI conversion |
Docker Hub publishing flow
Build and test locally first:
docker build -t YOUR_DOCKERHUB_USERNAME/obsidian-epub-pipeline:latest .
docker run --rm ^
-v /path/to/markdown/share:/vault ^
-v /path/to/epub/output:/output ^
YOUR_DOCKERHUB_USERNAME/obsidian-epub-pipeline:latest
Then log in and push:
docker login
docker push YOUR_DOCKERHUB_USERNAME/obsidian-epub-pipeline:latest