简体   繁体   English

以编程方式将HTML文件转换为epub文件(命令行ubuntu)

[英]Convert HTML files to epub files programmatically ( command line ubuntu )

Is it possible to convert a HTML5 file or text to epub file via a unix command line ? 是否可以通过unix命令行将HTML5文件或文本转换为epub文件? Is it possible to automate this process ?? 是否可以自动化这个过程?

thanks 谢谢

You can try pandoc 你可以尝试pandoc

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

You can add metadata for epub: 您可以为epub添加元数据:

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

Metadata xml file: metadata.xml 元数据xml文件: 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 我在pandoc中发现了一些断行错误,这在ebook-convert中没有发生

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM