Opiniated Reveal slideshow generator with nice PDF output and ability to treat notes as first-class content.
npm install -g prezIn your terminal, go to an empty directory and run:
prez --initA sample workspace has been generated for you. Then run:
prez --serve --print --watch- edit your slides from
slidesfolder (html or markdown) - dynamic content insertion can be performed using Mustache tagging, sourced from content in the
datafolder. - if you need some assets, you can work in
images,css,js,mediafolders and useincludes.txt - your slideshow is automatically built into
buildfolder - your slideshow is hosted and your browser is opened to localhost:9000
- any change you make will rebuild and refresh your browser
- oh, and a printer-friendly
slides.pdfis automatically generated on any change too
- Slides and chapters are sorted by name.
- If a slide or a chapter name starts with a dot
.(hidden), it will be skipped. (or use--keep-hidden) - You can number your slides to ensure order by adding a "number-" prefix, it will be automagically stripped out.
- Each slide will have an id generated from filename (removing accents and spaces).
- If you use
--sub-coversthe title is the stripped name, accents and case remain untouched.
data/
props.json
text.json
images/
js/
css/
slides/
01-intro.md
02-Chapter 1/
01-hello-world.md
02-bonjour-monde.md
03-conclusion.md
# Slide's title
Content of your slide
note:
Your notes go here.
Complex (multiline, code samples, etc.) notes are really supported only with --such-notes.You can set per-slide properties like general style, background or transition by adding special lines at the head of your slides:
$class:some class$add class$id:id$replace automatic id, if you set it to "none", it will remove any id on the slide- Any other property will be added as a data-attribute, here are some examples supported by Reveal:
$background:/path/to/image.jpg$$background-video:/path/to/video.webm$$background-iframe:http://mysite.com$$transition:zoom$$transition-speed:fast$
mkdir sandbox
cd sandbox
prez --initThis will create a full workspace with js, images, etc… where you'll put your custom content. In reality the only required folder is slides.
prezThis will create a build folder with your slideshow.
prez --serveThis will run a server on port 9000 and open your local browser to your slideshow.
prez --print --print-theme=simpleThis will generate "slides.pdf" from your slideshow.
Option --such-notes modifies the print layout and the notes popup so that notes have more space.
Mustache provides a stateless token/value replacement syntax (eg. {{ myVar }}), which permits build time customization of your Prez slides.
The input data is a merge of all the JSON files in the /data folder (see --data-dir option.) For example, the data/text.json file contains a nested map that includes text.hello key. This is merged with any other json files, and the result is a map that contains:
{
"text" : {
"hello" : "Hello World",
...
},
...
}During the build, the an instance of {{ text.hello }} would be replaced by the matching data value of Hello World.
prez [<source> [<destination>]] [options]
sourceis the slideshow workspace (where you'll have your slides and assets), default =./destinationis the target directory, default =./build/
-v,--version: show version and exit-s <dir>,--slides-dir=<dir>: customize name of the folder containing slides (default =slides)-d <dir>,--data-dir=<dir>: location of input JSON files to populate Mustache fields in slides. (default =data)
Assets & slides
--skip-reveal: do not copy reveal.js slides into target directory (useful if you want faster build over existing build)--skip-index: do not generateindex.htmlin target (will remain untouched if already existing)--skip-user: do not include user assets--skip-data: do not process mustache templates, for slightly faster builds--keep-hidden: render slides or chapters starting with a dot.--sub-covers: auto generate cover slides with the dir name as a h1 for each group of vertical slides
Meta
--title=<title>: specify the title of your presentation (default =package.json nameif found orPrez)--author=<author>: specify the author of your presentation (default =package.json authorif found)--description=<description>: specify the description of your presentation (default =package.json descriptionif found)
Theme
--theme=<theme>: choose reveal theme (default =solarized)--highlight-theme=<theme>: choose highlight.js theme (default =zenburn)--no-dynamic-theme: disable ability to change theme from query string--print-notes: enable special print layout with first-class notes--such-notes: focus on notes, which will enable a special print layout with notes as first-class content, and more space for them in the notes popup
Live server
-w,--watch: automatically rebuild (lazy) on changes--serve[=<port>]: serve slideshow (you can specify port here or use--port)-p <port>,--port=<port>: modify http server port (default 9000), you can use valueautoto use a random available port--no-live-reload: disable live-reload when serving slideshow--no-open-browser: do not open local browser automatically when serving slideshow
--print[=<file>]: print slideshow as pdf (requires--serveand phantomjs must be installed)--print-theme=<theme>: theme to be used for pdf output (default = no override)--phantomjs=<path to phantomjs>: path to phantomjs (default =phantomjs)
Misc
--no-update-notifier: disable version checking
You can store your default preferences in a configuration file. Take a look at CONFIG.md for details.
- Lazier reprint in watch mode
- FIX issue with notes too tall in printed pdf

