Pandoc是使用Haskell语言编写的一款跨平台、自由开源及命令行界面的标记语言转换工具,可实现不同标记语言间的格式转换,堪称该领域中的“瑞士军刀”[3]。
Pandoc支持的标记语言格式
Pandoc可读取的源格式 | Pandoc可生成的目标格式 |
---|---|
|
|
Pandoc的使用
Pandoc的基本指令格式是[4]:
pandoc [options] [input-file] ...
简单的格式转换指令:
pandoc -o output.html input.md
其中-o ouput.html
表示输出文件为output.html,input.md是输入文件。
Pandoc会根据文件的后缀名自动判断格式,用户也可以显式地指定输入文件和输出文件格式:
pandoc -f markdown -t html -o output.html input.md
其中-f markdown
表示输入文件格式为Markdown,-t html
表示输出文件格式为HTML。
详细的指令参数请参见Pandoc用户手册 (页面存档备份,存于互联网档案馆)。
参考资料
外部链接
Wikiwand in your browser!
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.