ipython/nbconvert — pull request #63 by damianavila (2012-12-04 04:19:17+00:00)
Title: Reveal converter

Abstract
-----------

This PR implement a new option in nbconvert to output a html-slideshow based in the [reveal](http://lab.hakim.se/reveal-js) javascript library.

Introduction
----------------

The publication of computational results through the **IPython Notebook** have gained a lot of interest in the scientific python community. **nbconvert** provides multiples output formats to distribute the IPython notebook content, even there is a web app service to automate the process of publication.
However, up to now there is a lack of a slideshow output format, a static html presentation tool (we have to mention that there is **live** slideshow mode in the current developing version of IPython).
So, we proposed us to implement a slideshow output format for nbconvert based in a html presentation framework called **reveal.js**.

Implementation
---------------------

Some backgroud:
- **reveal.js** is a library that provides easy features to integrate markdown written slides in the html code (through **data-markdown**, you can see the details in the reveal.js documentation).
- **nbconvert** have a specific option to output a mardown-based document.

So, the main idea was to link this two features to get a functional implementation to provide a new output format: **reveal** (a html slideshow)
To achieve this, we have written a new class called ConvertedReveal inherited from ConvertedMardown. This new class overwrite four method:

- **def optional header**, to pass a **home-made** header template to the the slideshow html file.
- **def optional footer**, to pass a **home-made** footer template to the the slideshow html file.
- **def convert**, to build the slides from lines (a list that contains the cells from the notebook. This method also add specific html tags to **encapsulate** each slide to be rendered properly by reveal.js. The delimiter of the slides is markdown rule ---, and the detection of this string is essential to build the slides.
- **def save**, to generate a file called name_of notebook_slides.html containing the slideshow itself.

Results
----------

To test this new **reveal** option in nbconvert you can checkout to the branch slider_converter in the repository in the following link: https://github.com/damianavila/nbconvert.git
In this repository, we provide a example_slide.ipynb to perform some testing of the new described feature.

**Usage**: $python nbconvert.py -f reveal example_slide.ipynb

You can also see this new functionality in the following video: http://www.youtube.com/watch?v=mNEAJvFDneE&feature=g-upl

Conclusion
---------------

We have achieved an easy and simple implementation of a static html slideshow based in reveal.js library. There is a lot of work to do to enhance this feature or even rewritten to test other possibilities.

We are waiting for your reviews and criticism.
Regards.

Damián.