Skip to content

Instantly share code, notes, and snippets.

@eduard-sukharev
Created March 23, 2017 14:37
Show Gist options
  • Save eduard-sukharev/8706d999f629b9801c5e3a3791bb725d to your computer and use it in GitHub Desktop.
Save eduard-sukharev/8706d999f629b9801c5e3a3791bb725d to your computer and use it in GitHub Desktop.
Convert Markdown book sources to Epub
#!/bin/sh
# Be sure to remove top level book titles from the beginning of each chapter' file, otherwise
# you'll get blank page with book title and chapter subtitle before each chapter
# Plain markdown allows html tags inclusion for images.
pandoc -o mybook.epub -f markdown -t epub -s --toc --toc-depth=2 ch1.md ch2.md ch3.md metadata.yml
---
title:
- type: main
text: Book series title
- type: subtitle
text: Specific Book title
creator:
- role: author
text: John Smith
identifier:
- scheme: ISBN-10
text: 1-2345-6789-0
publisher: Oh'Realy Media
rights: © Creative Commons
cover-image: cover.jpg
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment