美文网首页
asciidoctor + wkhtmltopdf

asciidoctor + wkhtmltopdf

作者: 陈成_Adam | 来源:发表于2022-12-10 13:29 被阅读0次

Asciidoctor 类似于 Markdown,也是一种标记语言。详细请参看 Asciidoctor | A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML5, DocBook, PDF, and other formats.

Vulkan 的官方文档便采用的是 Asciidoctor。详细请参看 Introduction - Vulkan Tutorial (vulkan-tutorial.com)

Vscode 和 Pycharm 等都有其相关的插件。我采用的书写环境是 Pycharm。

使用 Pycharm,

  • 有相关语法高亮和语法提示
  • 可以立即预览书写效果
  • 可以一键转化成 PDF、DOCX、HTML

但是转化成 PDF 的功能不支持中文。这里需要用到另外一个工具 wkhtmltopdf。详细请参看 wkhtmltopdf

两步转化,

  1. 先转化成 HTML
  2. 将 HTML 转化成 PDF
wkhtmltopdf index.html index.pdf

或者

wkhtmltopdf -n --enable-local-file-access index.html index.pdf

转化成 PDF 的功能不支持中文,还有另外一个官方提供的方法:

Creating PDFs for non-latin languages and extra fonts :: IntelliJ AsciiDoc Plugin (ahus1.de)

相关文章

网友评论

      本文标题:asciidoctor + wkhtmltopdf

      本文链接:https://www.haomeiwen.com/subject/unpzfdtx.html