以编程方式从 xml2rfc 生成 epub
Generating epub from xml2rfc programmatically
我正在使用 xml2rfc to write the RFC for NetJSON, I found out it is possible to export the RFC in epub format through the online service xml2rfc.ietf.org,但我还没有找到一种不使用在线服务以编程方式执行此操作的简单方法。
我使用脚本自动更新网站上 link 版本的 HTML 版本的 RFC 草稿,目前我真的很想为 ePub 版本做同样的事情我没有link网站上的epub版本,因为我必须手动更新它,这很耗时,所以我偶尔会这样做。
在这种情况下有什么工具可以帮助我吗?
xml2rfc does not support epub, the webpage 提及
EPub support is provided using version 0.8 of ebook-convert.
PS and RTF support are provided using a combination of wkhtmltopdf, pdf2ps and/or GNU enscript.
您可以尝试像 EbookLib (installed through pip) or you can run calibre 这样的库作为一个过程。
更新:其实毕竟是一行命令
安装口径(Ubuntu 15.10 在我的例子中):
sudo apt-get install calibre
运行 命令(doc)(这是从 epub 到其他格式,但你可以反过来做)
ebook-convert Metamorphosis-jackson.epub something.pdf
您可以选择多种输出格式。 (http://manual.calibre-ebook.com/cli/ebook-convert.html#epub-output-options)
输出:
1% Converting input to HTML...
InputFormatPlugin: EPUB Input running
on /home/<user>/other/xml2rfc/Metamorphosis-jackson.epub
Found HTML cover OEBPS/front-cover.html
Parsing all content...
MediaQuery: Unknown media type "amzn-kf8".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Detected chapter: CHAPTER I
Detected chapter: CHAPTER II
Detected chapter: CHAPTER III
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating PDF Output...
67% Running PDF Output plugin
The cover image has an id != "cover". Renaming to work around bug in Nook Color
71% Rendered title-page.html
76% Rendered copyright.html
81% Rendered table-of-contents.html
85% Rendered pressbooks-promo.html
90% Rendered chapter-001-chapter-i.html
95% Rendered chapter-002-chapter-ii.html
100% Rendered chapter-003-chapter-iii.html
Rendered PDF in 0.915601 seconds:
PDF output written to /home/<user>/other/xml2rfc/something.pdf
Output saved to /home/<user>/other/xml2rfc/something.pdf
我正在使用 xml2rfc to write the RFC for NetJSON, I found out it is possible to export the RFC in epub format through the online service xml2rfc.ietf.org,但我还没有找到一种不使用在线服务以编程方式执行此操作的简单方法。
我使用脚本自动更新网站上 link 版本的 HTML 版本的 RFC 草稿,目前我真的很想为 ePub 版本做同样的事情我没有link网站上的epub版本,因为我必须手动更新它,这很耗时,所以我偶尔会这样做。
在这种情况下有什么工具可以帮助我吗?
xml2rfc does not support epub, the webpage 提及
EPub support is provided using version 0.8 of ebook-convert.
PS and RTF support are provided using a combination of wkhtmltopdf, pdf2ps and/or GNU enscript.
您可以尝试像 EbookLib (installed through pip) or you can run calibre 这样的库作为一个过程。
更新:其实毕竟是一行命令
安装口径(Ubuntu 15.10 在我的例子中):
sudo apt-get install calibre
运行 命令(doc)(这是从 epub 到其他格式,但你可以反过来做)
ebook-convert Metamorphosis-jackson.epub something.pdf
您可以选择多种输出格式。 (http://manual.calibre-ebook.com/cli/ebook-convert.html#epub-output-options)
输出:
1% Converting input to HTML...
InputFormatPlugin: EPUB Input running
on /home/<user>/other/xml2rfc/Metamorphosis-jackson.epub
Found HTML cover OEBPS/front-cover.html
Parsing all content...
MediaQuery: Unknown media type "amzn-kf8".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
MediaQuery: Unknown media type "amzn-mobi".
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Detected chapter: CHAPTER I
Detected chapter: CHAPTER II
Detected chapter: CHAPTER III
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating PDF Output...
67% Running PDF Output plugin
The cover image has an id != "cover". Renaming to work around bug in Nook Color
71% Rendered title-page.html
76% Rendered copyright.html
81% Rendered table-of-contents.html
85% Rendered pressbooks-promo.html
90% Rendered chapter-001-chapter-i.html
95% Rendered chapter-002-chapter-ii.html
100% Rendered chapter-003-chapter-iii.html
Rendered PDF in 0.915601 seconds:
PDF output written to /home/<user>/other/xml2rfc/something.pdf
Output saved to /home/<user>/other/xml2rfc/something.pdf