Convert HTML files to epub files programmatically ( command line ubuntu )
Asked Answered
F

2

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

Fanya answered 7/2, 2014 at 11:10 Comment(0)
P
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

Planospore answered 7/2, 2014 at 11:41 Comment(0)
C
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

Capitular answered 3/11, 2018 at 20:11 Comment(1)
And to add metadata and cover, you can use ebook-meta in combination with ebook-convertMuumuu

© 2022 - 2024 — McMap. All rights reserved.