26

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

2 Answers 2

34

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

16

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

1
  • And to add metadata and cover, you can use ebook-meta in combination with ebook-convert Commented Apr 10, 2023 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.