reveal.js on steroids! Get beautiful reveal.js presentations from your Markdown files.
npm install -g reveal-md
reveal-md path/to/my/slides.md
This starts a local server and opens your Markdown file as a reveal.js presentation in the default browser. Remote resources are also possible:
reveal-md https://raw.githubusercontent.com/webpro/reveal-md/master/demo/a.md
Get a quick preview with a few demo decks:
reveal-md demo
- Markdown
- Theme
- Highlight Theme
- Custom Slide Separators
- Custom Slide Attributes
- Reveal.js Options
- Speaker Notes
- YAML Front Matter
- Live Reload
- Custom Scripts
- Pre-process Markdown
- Print to PDF
- Static Website
- Disable Auto-open Browser
- Directory Listing
- Custom Port
The Markdown feature of reveal.js is awesome, and has an easy (and configurable) syntax to separate slides. Use three dashes surrounded by two blank lines (\n---\n
). Example:
# Title
* Point 1
* Point 2
---
## Second slide
> Best quote ever.
Note: speaker notes FTW!
Override theme (default: black
):
reveal-md slides.md --theme solarized
See available themes.
Override reveal theme with a custom one. In this example, the file must be at ./theme/my-custom.css
:
reveal-md slides.md --theme my-custom
Override reveal theme with a remote one (use rawgit.com because the url must allow cross-site access):
reveal-md slides.md --theme https://rawgit.com/puzzle/pitc-revealjs-theme/master/theme/puzzle.css
Override highlight theme (default: zenburn
):
reveal-md slides.md --highlight-theme github
See available themes.
Override slide separator (default: \n---\n
):
reveal-md slides.md --separator "^\n\n\n"
Override vertical/nested slide separator (default: \n----\n
):
reveal-md slides.md --vertical-separator "^\n\n"
You can use the reveal.js slide attributes functionality to add HTML attributes, e.g. custom backgrounds. Alternatively you could add an HTML id
attribute to a specific slide and style it with your own CSS.
If you want yor second slide to have a png background:
# slide1
This slide has no background image.
---
<!-- .slide: data-background="./image1.png" -->
# slide2
This one does!
You can define Reveal.js options in a reveal.json
file that you should put in the root directory of the Markdown files. They'll be picked up automatically. Example:
{
"controls": true,
"progress": true
}
You can use the speaker notes feature by using a line starting with Note:
.
You can set markdown options and revealoptions specific to your pressentation in the .md file with YAML front matter header Jekyll style.
---
title: Foobar
separator: <!--s-->
verticalSeparator: <!--v-->
theme: solarized
revealOptions:
transition: 'fade'
---
Foo
Note: test note
<!--s-->
# Bar
<!--v-->
Using -w
option changes to markdown files will trigger the browser to
reload and thus display the changed presentation without the user having
to reload the browser.
Inject custom scripts into the page:
reveal-md slides.md --scripts script.js,another-script.js
reveal-md
can be given a markdown preprocessor script via the --preprocessor
(or
-P
) option. This can be useful to implement custom tweaks on the document
format without having to dive into the guys of the Markdown parser.
For example, to have headers automatically create new slides, one could have
the script preproc.js
:
// headings trigger a new slide
// headings with a caret (e.g., '##^ foo`) trigger a new vertical slide
module.exports = (markdown, options) => {
return markdown.split('\n').map((line, index) => {
if(!/^#/.test(line) || index === 0) return line;
const is_vertical = /#\^/.test(line);
return (is_vertical ? '\n----\n\n' : '\n---\n\n') + line.replace('#^', '#');
}).join('\n');
};
and use it like this
$ reveal-md --preprocessor preproc.js slides.md
Requires phantomjs to be installed (preferably globally)
This will create a PDF from the provided Markdown file and saves a PDF file:
reveal-md slides.md --print slides.pdf
This will produce a standalone version of the passed file in HTML including static scripts and stylesheets.
The files are saved to the directory passed to the --static
parameter, or ./_static
if not provided:
reveal-md slides.md --static _site
Disable to automatically open your web browser:
reveal-md slides.md --disable-auto-open
Show (recursive) directory listing of Markdown files:
reveal-md dir/
Show directory listing of Markdown files in current directory:
reveal-md
Override port (default: 1948
):
reveal-md slides.md --port 8888
- Slides is a place for creating, presenting and sharing slide decks.
- Sandstorm Hacker Slides, a simple app that combines Ace Editor and RevealJS.
- Tools in the Plugins, Tools and Hardware section of Reveal.js.