Skip to content

Instantly share code, notes, and snippets.

@shigeyas
Created November 11, 2013 02:06
Show Gist options
  • Save shigeyas/7406637 to your computer and use it in GitHub Desktop.
Save shigeyas/7406637 to your computer and use it in GitHub Desktop.
#!/bin/sh
case $# in
1);;
*) echo usage: pandoc2epub SOURCE; exit;;
esac
case $1 in
*.html) EXT=.html;;
*) EXT=;;
esac
pandoc -f html -t epub3 --epub-chapter-level=2 $1 -o `basename $1 $EXT`.epub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment