用TOC将Jekyll文档转换为PDF [英] Jekyll documentation to PDF with TOC

查看:161
本文介绍了用TOC将Jekyll文档转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用带有HTML和PDF输出的 Jekyll 来编写文档. HTML可以具有导航,但是PDF应该具有目录.有免费且容易的方法吗?

I would like to write documentation using Jekyll with HTML and PDF outputs. Html can have a navigation but the PDF should have table of contents. Is there a free and easy way to do that?

HTML部分很简单,但我想使用@media print CSS制作PDF文件.

The HTML part is easy but I would like to use @media print CSS for making the PDF file.

我对如何执行此操作有一些想法.

I have a few ideas how to do this.

  1. 使用 PrinceXML ,不幸的是,这是价格不菲的商业产品,价格约为$ 500
  2. 使用 WKHTMLTOPDF
  3. 使用 Maruku ,因为可以使用它进行PDF转换
  1. Use PrinceXML, unfortunately this is commercial product with a nasty price tag ~$500
  2. Use WKHTMLTOPDF
  3. Use Maruku, since it is possible to do a PDF conversion using it

我希望具有TOC的多页HTML和单页PDF.有什么建议?

I would like to have multiple pages HTML and single page PDF with a TOC. Any suggestions?

顺便说一句. 构建器使用推荐答案

如果免费"是您最重要的标准,那么wkhtmltopdf是您的最佳选择.它支持诸如封面,目录,页眉,页脚和节之类的内容.根据文档布局的奇异程度,您很可能会遇到一些分页符问题,但是稍作修改便可以了.

If 'free' is your most important criterion, than wkhtmltopdf is your best bet. It supports things like covers, toc, headers, footers and sections. Depending on how exotic the layout of your document will be, you most likely will run into some page-break issues, but with a bit of tinkering you should be fine.

我已经使用wkhtmltopdf了一段时间,其中包含一些非常复杂的文档(包括javascript图表,表格,svg图像等),并且没有遇到太多问题.

I've been using wkhtmltopdf for a bit now, with some quite complicated documents (with javascript charts, tables, svg images, etc.) and have not run into too many issues.

请确保使用wkhtmltopdf的静态版本,因为它是唯一支持呈现TOC页面的版本.

Make sure you use the static version of wkhtmltopdf, as it is the only version which supports rendering of a TOC page.

这篇关于用TOC将Jekyll文档转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆