Pandoc 快速上手

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013614126/article/details/83047112

简介

本文介绍 Pandoc (源码) 的基本概念和日常使用命令/方式/工作流。

环境

  • Unity 2018.2.5f1 Personal (64bit)

基本概念

Pandoc 是一个通用的标记式文档格式转换器。例如 markdown 转 html, word 转 html 等。

工作流

安装

下载:https://github.com/jgm/pandoc/releases

例如:https://github.com/jgm/pandoc/releases/download/2.3.1/pandoc-2.3.1-windows-x86_64.msi

参考:官方安装指南

下载完成后双击安装一路默认即可。

使用

# 格式
pandoc [options] [input-file]…
pandoc -f 源格式(from) -t 目标格式(to) -o 输出文件名(不指定就输出到命令行)hello.txt

常用格式

# 需要形成独立文件(standalone)的加上 -s 选项
# 需要形成文件而不是命令行输出的加上 -o 指定输出文件名

# markdown 转 html5 独立文件
pandoc -s -o output.html input.md

# markdown 转 latex
pandoc -f markdown -t latex -o hello.tex hello.txt

# markdown 转 reveal.js html
pandoc -s -t revealjs slides.md

所有支持的格式列表见:https://pandoc.org/MANUAL.html#options

参考

  1. 官方手册

猜你喜欢

转载自blog.csdn.net/u013614126/article/details/83047112