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

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


You can try pandoc

sudo apt-get install pandocpandoc -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


Another option is using the following after installing calibre.

ebook-convert  input.html output.epub

I found some break lines errors with pandoc, that didn't happen with ebook-convert

Source