Authoring presentations with Docker, reveal.js and Pandoc

By Beerend Lauwers

I’ve always liked reveal.js’ style of HTML5 presentations, and I know you can write them in MarkDown as well. I don’t want to install NodeJS and Python and all the other dependencies to get a local development environment going, so I’ll try and use Docker.

Getting a reveal.js testing server up and running with Docker (failed)

First off, I downloaded this docker image:

docker pull docker-reveal.js:latest
Error: image library/docker-reveal.js:latest not found

Good start.

$ git clone
$ cd docker-reveal.js
$ docker build -t "danidemi/docker-reveal.js:latest" .

That works. Took AGES, though.

Next up, the tutorial says to

Run a Docker container with this command.

docker run -d -v //c/Users/blauwers/AppData/Roaming/hakyll/reveal:/slides/ -p 8000:8000 "danidemi/docker-reveal.js:latest"

Then, I tried to get the pandoc install in the container to compile my MarkDown file:

(docker exec -i $dockerid /bin/sh -c "pandoc -t revealjs -s -o /slides/index.html") <

Doesn’t work. The container keeps dying. Let’s inspect with -i:

docker run -i -v //c/Users/blauwers/AppData/Roaming/hakyll/reveal:/slides/ -p 8000:8000 "danidemi/docker-reveal.js:latest"

(a whole bunch of retries to find index.html)

Ah, NodeJS keeps trying to look for index.html, crashing due to running out of stack size.

Let’s add index.html and try again.

touch index.html

Ok, now it doesn’t crash anymore (this was apparently in the tutorial, woops).

Unfortunately, the docker exec command still doesn’t work, it’s trying to use my Git’s bin/sh in Program Files.

Docker + Windows install of pandoc

Ok, screw it, let’s just install pandoc for Windows.

Now, let’s go to the folder and run it there:

cd C:\Users\blauwers\AppData\Roaming\hakyll\reveal
C:\Users\blauwers\AppData\Roaming\hakyll\reveal>pandoc -t revealjs -s -o index.html

Ok, now to refresh the web page of the docker instance:

First successful compilation

First successful compilation

Seems to work!

Windows install of pandoc + copy of the Git repo of reveal.js

Wow, what a hassle. Can’t I just use the static version of reveal.js?

Release overview -> zip -> put in it -> compile!

Just a white screen.

Hmm, seems like pandoc-compiled presentations search for reveal.js in a subfolder called reveal.js.

Let’s plonk the file just next to the reveal.js folder.

Ok, now I’m getting my text. But the presentation functionality isn’t present, nor is the CSS styling. Two more changes are required:

(Of course, actually minifying it would be a good idea if we’d actually publish this presentation.)

Great, works on localhost now without a docker image!

Switching themes (not working)

Let’s try another theme:

pandoc -t revealjs -s -V theme=moon -o index.html

Hmm, can’t switch themes. Weird.

It’s in the HTML, in any case:

theme: 'moon', // available themes are in /css/theme

I’ll leave it for the moment.

Swapping out pandoc’s syntax highlighting for highlight.js

The Haskell code is really unreadable:

Unreadable Haskell code!

Unreadable Haskell code!

Let’s disable it:

pandoc -t revealjs -s --no-highlight -o index.html

How to get highlight.js functionality in? Let’s google around.

You can use snippet below, insert it in the top of markdown file:

<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>

<style>body { padding: 20px } pre { padding: 0 }</style>

$(function() {
    $("pre > code").each(function(i, block) {
        var codeClass = $(this).parent().attr("class");
        if (codeClass == null || codeClass === "") {
        } else {
            var map = {
                js: "javascript"
            if (map[codeClass]) {
                codeClass = map[codeClass];


Readable Haskell code!

Readable Haskell code!

That’s a lot better!