pandoc安装

pandoc安装

 sudo apt-get install pandoc

pandoc语法

Pandoc 程序的命令使用方式为:

$ pandoc <files> <options>
其中 <files> 为输入的内容,其输入即可以来自文件,也可以来自标准输入甚至网页链接。而 <options> 为参数选项。主要的参数选项有:

    -f <format>、-r <format>:指定输入文件格式,默认为 Markdown;
    -t <format>、-w <format>:指定输出文件格式,默认为 HTML;
    -o <file>:指定输出文件,该项缺省时,将输出到标准输出;
    --highlight-style <style>:设置代码高亮主题,默认为 pygments;
    -s:生成有头尾的独立文件(HTML,LaTeX,TEI 或 RTF);
    -S:聪明模式,根据文件判断其格式;
    --self-contained:生成自包含的文件,仅在输出 HTML 文档时有效;
    --verbose:开启 Verbose 模式,用于 Debug;
    --list-input-formats:列出支持的输入格式;
    --list-output-formats:列出支持的输出格式;
    --list-extensions:列出支持的 Markdown 扩展方案;
    --list-highlight-languages:列出支持代码高亮的编程语言;
    --list-highlight-styles:列出支持的代码高亮主题;
    -v、--version:显示程序的版本号;
    -h、--help:显示程序的帮助信息。

生成Html

 pandoc demo.md -o demo.html
 pandoc demo.md -c style.css -o demo.html

生成word

 pandoc demo.md -o demo.docx //md --> word
 pandoc demo.docx -o demo.md  // word -->md
 pandoc http://xxx.com/xxx -o this_page.docx  //html-->word

生成PDF

 pandoc demo.md -o demo.pdf

相关链接

http://gnss.help/2017/06/12/pandoc-install-usage/index.html
https://zhaozhiyuan.org/post/install-pandoc/

猜你喜欢

转载自www.cnblogs.com/tomtellyou/p/12808953.html