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。
两步转化,
- 先转化成 HTML
- 将 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)
网友评论