hakimel/reveal.js — pull request #429 by cw4gn3r (2013-05-01 00:34:15+00:00)
Title: Feature: write presentations using Jade templates

Hi, I recently gave a talk at my company on JavaScript, and I decided to use your awesome framework to author the slides. While I loved the functionality and style overall, I did not really feel like stuffing all my slides into a giant HTML file together with a page full of boilerplate for the setup. So – I wrote my own preprocessor to allow me to write slides in [Jade](http://jade-lang.com/).

I extracted the boilerplate into a template, added a simple configuration file in JSON format (`slides.json`), and extended the `Gruntfile` with tasks for automating the compilation (Jade to HTML) process. I even included a "watch" task that uses `grunt-contrib-connect` to run web server at the same time to preview the presentation. One can simply run `grunt serve` and start editing the presentation, and every time you save the HTML will be updated automatically.

## Features

- Write reveal.js presentations in Jade instead of HTML
- Easy configuration via JSON
- Large presentations can be split up into multiple files
- Markdown support
- Built-in webserver and watch task automates compilation and simplifies preview

## Instructions

Slide content goes into the `slides` directory. Create as many `.jade` files in here as you need to. Some samples are provided.

The `slides.json` is the main project file. Edit it to change the presentation metadata (`title`, `author`, and `description`), and configure reveal.js options using the `options` key. Finally, in the `slides` array, add all your `.jade` files in the `slides` directory in the order you want them included.

### Commands

`grunt slides`: reads `slides.json` and compiles all the Jade templates listed within into HTML. Output is written to `slides.html`

`grunt serve`: runs a webserver (listening on port 8000) that serves up the slides. Should work with the presenter-notes plugin. Also keeps watching for changes to `slides.json` and any file in the `slides` directory, and recompiled the presentation if anything was changed. This is the main task I use for authoring the presentation, as all I have to do is save a file and hit "reload" in the browser to see my changes.

`grunt package`: packages the presentation and all necessary dependencies into a `.zip` file for easy sharing. In case the PDF export isn't good enough.

## Note

I'm sending you this pull request not necessarily because I want you to merge this and include it in the main distribution (unless you want to). Perhaps this should be a standalone tool that just uses reveal.js as a backend, so it doesn't add extra complexity to your code. It's up to you. However, I wasn't able to find reveal.js as a npm-installable package, so forking the project was the easiest way for me to get started.

I just wanted to say thanks for your cool framework and show you something awesome I've built with it. Give it a look, try it out, and let me know what you think. :)