Pandoc是使用Haskell语言编写的一款跨平台、自由开源及命令行界面的标记语言转换工具,可实现不同标记语言间的格式转换,堪称该领域中的“瑞士军刀”:
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。
详细的指令参数请参见[https://pandoc.org/MANUAL.html Pandoc用户手册] 。
参考资料
外部链接
- [http://johnmacfarlane.net/pandoc/README.html Pandoc用户手册(HTML格式)]
- [http://johnmacfarlane.net/pandoc/try/ 在线试用Pandoc]
- [http://hackage.haskell.org/package/pandoc Haskell库中的Pandoc包]
- [https://github.com/jgm/pandoc Pandoc项目的Github页面]
- [https://code.google.com/p/pandoc/ Pandoc项目的Google Code页面](自1.12.3版本后已移至Github)
- [https://github.com/jgm/pandoc/wiki/Pandoc-Extras#editors 支持Pandoc绑定或插件的文本编辑器列表]
评论 (0)