Serving reveal slides with ease
Getting reveal.js into a docker container the way I want it
I have recently started talking at meetups like PyData London about my experiences as a Data Scientist in a startup. I have also recently been moving onto docker to manage my development environment following a bumpy couple of years with MacPorts.
I wanted to use reveal.js to present the slides and found it simple to get a working setup but cloning the repo into each project I want to present from seemed awkward. I decided to find a docker image to do the job.
After a little searching, I found the markdown compatible parente revealjs image on docker hub. While this seemed good at first, it did not abstract the slides from the image, so I decided to change it to suit my needs. The result of this is revealjs-docker, which is available on docker hub as revealjs, a public docker image. If you have docker installed and a presentation in slides.md, simply run:
$ docker run --rm -v "$(pwd)/slides.md:/revealjs/slides.md" -p 8001:8000 calvingiles/revealjs
from the same directory and grunt will serve your slides on your localhost or your boot2docker ip at port 8001 — for me this is http://192.168.59.103:8001/. To export your slides as a pdf, add print-pdf as an argument, like http://192.168.59.103:8001/?print-pdf, to load a special css stylesheet for printing. You can then print your slides to pdf and they will be beautifully formatted! Note: this is only supported in chrome.
You can check out my slides on getting started with docker created using revealjs on slideshare.
Happy presenting!