wwj718 / reveal.js-with-pandoc

pandoc template of reveal.js slides

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reveal.js的pandoc模板

reveal.js的说明请看这里

文件说明

除了原版的reveal.js库里的文件以外,增加的文件有:

  • template-revealjs.html pandoc模板文件
  • slides.md 示例文件
  • /css/custom.css 用户自定义的样式文件

index.html是原版的演示文件,slides.md是我的示例文件,编译之后为slides.html,点这里查看效果

使用方法

如果源文件是Rmd文件,先用knitr处理

library(knitr)
knit("slides.Rmd")

得到md文件后运行命令:

pandoc -t html5 --template=template-revealjs.html --standalone --section-divs   --variable theme="default"   --variable transition="cube" slides.md -o slides.html

可直接运行build.bat批处理文件

注意,不管是直接在命令行下输命令,还是执行批处理文件,可以设置两个参数

  • theme 可选的reveal.js主题有:"sky", "beige", "simple","serif", "night", "default"
  • transition 可选的slides切换方式有:"default", "cube","page", "concave", "zoom", "linear", "fade", "none"

如果slides里有公式,需要在编译命令里加上--mathml选项

pandoc -t html5 --template=template-revealjs.html --mathml --standalone --section-divs   --variable theme="sky"   --variable transition="cube" slides.md -o slides.html

暂时只实现了用MathML来实现数学公式,其他方法还在摸索中。

其他

可以在http://rvl.io上在线编辑reveal.js的slides

About

pandoc template of reveal.js slides

License:MIT License


Languages

Language:CSS 40.9%Language:JavaScript 40.7%Language:HTML 18.3%Language:Batchfile 0.1%