Convert HTML files to epub files programmatically ( command line ubuntu )

badaboum picture badaboum · Feb 7, 2014 · Viewed 10k times · Source

Is it possible to convert a HTML5 file or text to epub file via a unix command line ? Is it possible to automate this process ??

thanks

Answer

mkjasinski picture mkjasinski · Feb 7, 2014

You can try pandoc

sudo apt-get install pandoc
pandoc -f html -t epub3 -o output.epub input.html

You can add metadata for epub:

pandoc -f html -t epub3 --epub-metadata=metadata.xml -o output.epub input.html

Metadata xml file: metadata.xml