25

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

badaboum
  • 843
  • 2
  • 17
  • 28

2 Answers2

33

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

mkjasinski
  • 3,115
  • 2
  • 22
  • 21
14

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

Ferroao
  • 3,042
  • 28
  • 53