By:farseer He
Hosted on:github
- This vim plugin is made mainly for converting markdown files to reveal.js presentations.
- The details of markdown syntax.
- Works better with vim-regionsyntax
- Use your favorite vim package managing plugin(such as vundle/pathogen/neobundle).
- Clone reveal.js somewhere.
- Add something like this to your vim configuration file.
let g:reveal_root_path = 'your-reveal.js-path' " '$HOME/reveal.js/' will be used if not specified.
let g:reveal_default_config = {
\'fname' : 'reveal', " The name of generated html file will be 'reveal.html'
\'key1': 'value1',
\'key2': 'value2',
\ ...} " Default options for reveal.js.
- Edit your markdown file.
- :RevealIt will help you open the generated html file.
- :!Your-favorite-browser % will show the presentation in your browser.
- heads
- github flavored code blocks with syntax highlighting.
#include <stdio.h>
int main(int argc, char const* argv[])
{
puts("hello, world!");
return 0;
}
- tables
Head1 | Head2 | Head3 | Head4 | Head5 | Head6 | Head7 |
---|---|---|---|---|---|---|
aaaaa | bbbbb | ccccc | ddddd | eeeee | fffff | 00000 |
aaaaa | bbbbb | ccccc | ddddd | eeeee | fffff | 00000 |
aaaaa | bbbbb | ccccc | ddddd | eeeee | fffff | 00000 |
To add sections each of which means a single page in the presentation,you can do something like this:
(Here the '^' means a start of new line instead of the actual character.)
^<!--sec1-->
The content of section 1.
^<!--sec2-->
The content of section 2.
...
This will be converted to:
<!--
<section data-markdown >
<script type="text/template">
The content of section 1.
</script>
</section>
<section data-markdown >
<script type="text/template">
The content of section 2.
</script>
</section>
-->
If you add this:
^<!--sec5.1-->
The content of section 1.1.
^<!--sec5.2-->
The content of section 1.2.
...
You can change the background color of a certain section using:
^<!--sec6.1 bg='#654321'-->
Also the transition and background transition ...
For more section options,please refer to the documents of reveal.js.
^<!--sec6.2 bg='#002b36' tr='linear' bgtr='slide'-->
Use this:
('secp' means section with plain html)
^ $$ \LaTeX \ \ \left(\begin{array}{|c|c|c|} x_{11} & x_{12} & \ldots \ x_{21} & x_{22} & \ldots \ \vdots & \vdots & \ddots \end{array} \right) $$
All of these could be added to a 'secp' section
any type
- of view
- fragments
grow
shrink
roll-in
fade-out
highlight-red
highlight-green
highlight-blue
You can specify several options with Meta tags at the top of the markdown file like this:
<!--Meta author:'your name' title:title-->
<!--Meta theme:'night' transition:'zoom'-->
<!--Meta width:900 height:1200-->
For all the available options,please check the documents of reveal.js.