利用pandoc把markdown转换为doc和ppt

参考首先到https://github.com/jgm/pandoc/releases下载pandoc

转换为doc比较简单

$pandoc -f markdown -t docx file.md -o file.docx

$pandoc file.md -o file.docx –mathjax

$pandoc file.md -o file.pptx –mathjax

转换为html

$ pandoc slides.md -o slides.html -s

转换为ppt
采用默认模板渲染一个独立的DZSlides幻灯片:

$ pandoc slides.md -o slides.html -t dzslides -s

首先需要从GitHub上获取https://github.com/hakimel/reveal.js

,将reveal.js同名的文件夹放在幻灯片所在目录下即可:

$ git clone https://github.com/hakimel/reveal.js

渲染幻灯片:

$ pandoc slides.md -o slides.html -t revealjs -s

除了默认的外观主题以外,reveal.js还提供了多个主题可供选择,

$ pandoc slides.md -o slides.html -t revealjs -s -V theme=beige

default:(默认)深灰色背景,白色文字
beige:米色背景,深色文字
sky:天蓝色背景,白色细文字
night:黑色背景,白色粗文字
serif:浅色背景,灰色衬线文字
simple:白色背景,黑色文字
solarized:奶油色背景,深青色文字

发表评论

电子邮件地址不会被公开。 必填项已用*标注