Giter Club home page Giter Club logo

docker-reveal.js's Introduction

Docker-reveal.js

Docker-reveal.js is a Docker image that let you run Reveal.js slideshows with ease. It embeds Pandoc to quickly convert markdown text in reveal.js enabled html.

Installation

This image is available on the Docker Hub, and it is automatically built each time an update is available, so the easiest way to get the image is to rely on Docker.

$ sudo docker pull docker-reveal.js:latest

If for any reason, you prefer to build the image yourself, just clone this repository and build the image yourself.

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

Create Your Slideshow

  1. Create a directory in your filesystem where you'll author and run your reveal.js slideshow.

    $ mkdir <my_fancy_slideshow> $ cd <my_fancy_slideshow>

  2. Run a Docker container with this command.

    $ docker run -d -v $(pwd):/slides/ -p 8000:8000 "danidemi/docker-reveal.js:latest"

  3. Point your browser to http://127.0.0.1:8000

  4. Start editing your slideshow file.

    $ touch index.html

  5. If you prefer to edit your slideshow in markdown, create a file following the explanations presented in the pandoc manual.

    $ touch index.md

  6. Let the pandoc installation included in the container to convert your .md file into a reveal.js enabled file.

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

  7. Your changes are immediately visible in the browser.

  8. Happy presentation

Issues

Plese, feel free to open any issue you should have on the GitHub project page.

Internals

This Docker Image is based on the default Reveal.js installation. Gruntfile.js, however defines two additional folders that are served through http, /slides and /pandoc.

  • /slides directory is meant to be used as a Docker volume, mapped to the folder on your host that contains the slideshow materials. This way, for instance, when you hit http://127.0.0.1:8000, the content that is actually served comes from /slides that in turn is mapped to your presentation directory on your host.

  • /pandoc directory is meant to provide .css and .js resources as expected by Pandoc produced files.

docker-reveal.js's People

Contributors

danidemi avatar

Stargazers

Lucky | Sharma Secure Services Inc avatar Dave Greenwood avatar Andrew Ang avatar Florian Heigl avatar Joe Palala avatar Chandan avatar Andy Prowse avatar Étienne BERSAC avatar Kodsama avatar Swaroop Bekal avatar Gerard Keating avatar Jean-Baptiste Pasquier avatar Sam Mingo avatar

Watchers

 avatar

docker-reveal.js's Issues

(P)resentation Mode doesn't seem to work

Well, if I hit 'p' it does go into Presentation Mode, yielding the window I need on my screen (i.e., current slide, next slide, notes for current slide, and notes for next slide), but there doesn't seem to be a way I can get the slides-only screen for the audience to view. That is, I would expect TWO windows, one containing the presenter view for my laptop screen, and one containing the audience view that I project on my second screen.

Hmmm, Instructions did not work for me... But I was able to fix it

I am trying to use the docker-reveal.js docker container, and it appears to run as a server, but it does not seem to be converting the Markdown file into HTML correctly. I have the server running:

$ docker ps
CONTAINER ID        IMAGE                              COMMAND                CREATED             STATUS              PORTS                    NAMES
28dda7209d63        danidemi/docker-reveal.js:latest   "/bin/sh -c 'grunt s   3 minutes ago       Up 3 minutes        0.0.0.0:8000->8000/tcp   pandoc

And my markdown file should be fine... I really have not added much to it:

% Fun with Ruby: Ruby On Rails
% Kevin Fries
% 9 May 2015

# Ruby On Rails

# Fun With Ruby Series
## Welcome

  - Introductions
      - Me
          - Denver/Boulder Linux Meetup Group
      - David
          - Software Freedom School
  - Agenda

## Technology Overview

  - Ruby vs Rails                                                                                                                              
      - What is Ruby?                                                                                                                          
      - What is Rails?                                                                                                                         
      - Why would Ruby want to be on "Rails"?                                                                                                  
  - ***My Definitions:***
      - Website
      - Web App

# What Ruby Pieces do we need to know?
## Overview

## Array Methods

## Classes

## Bundler

## Rake

# Rails Technology in details
## Overview

## MVC Development Model

## The Model

## The View

## The Controller

# Restful Interfaces
## What makes a program "REST"ful

## Mapping REST verbs

You have a little bit of a chicken and egg going on with your process here, but it is easily kludged around. If you are writing in Markdown, and trying to convert this to HTML, the container will not start unless index.html is present. So... you need to touch the index.html file to create it, even though you are just going to crush it in a moment. No big, I figured when I read your page, that I could skip that because I was using Markdown... but quickly gotten around.

So, I did a touch, and then ran my command again. Here is my revealjs start script:

#!/usr/bin/env bash

docker run -dit \
           --name pandoc
           -v $(pwd):/slides/ -p 8000:8000 \
           danidemi/docker-reveal.js:latest

pretty much what you had in the documents, with a few small modifications. I used the -i and -t, so in case needed to get into the container, it was easy to get back out via a ^C. And I named the container for reasons that will become obvious here in just a moment.

Now that the container is running, I tried to convert my Markdown into the HTML page so I could check how the slides would show up.

#!/usr/bin/env bash

filename=$1

if [ -z $filename ]; then filename=index.md; fi

target=$(basename $filename .md).html

$(docker exec -it pandoc /bin/sh -c "pandoc -t revealjs -s -o /slides/$target") < $filename

I called this script md2html, and again, I used your code almost verbatim. I simply adjust the script to work with an optional filename. No filename, and it will default to index.md, otherwise, it will set the output file to be the same name as the markdown file, only with an html extention. I insured that the correct instance was used by using that name I set in the revealjs file. I also added the -i and -t switches since it did not work without them...

but it does not seem to work any better with the -t and -i switches either.

With all the history of what I am doing out of the way, lets talk about how I fixed it.

When I run the md2html command, the process just seems to hang. No output seems to be going out:

$ ls -la
total 12
drwxr-xr-x 2 kfries kfries 4096 May  2 05:34 .
drwxr-xr-x 4 kfries kfries 4096 May  1 19:02 ..
-rw-r--r-- 1 kfries kfries    0 May  2 05:34 index.html
-rw-r--r-- 1 kfries kfries  737 May  1 20:15 index.md

Notice that the filesize of index.html is still zero, and this has been running for 15 minutes.

I ran the pandoc commands from the terminal individually, and found that there were errors in the command... for example, it did not like the -s switch. The process hung due to an error in the command it was trying to run inside the container.

I simplified the command, and took it out of the subshell. Pandoc will take an unnamed parameter as the source... no need to pipe it in, since the file was in the pwd, it is seen inside the container as /slides/, so /slides/index.md as the last parameter, and viola, no more pipe, or need for a subshell.

Now errors are appearing on the screen, and the process is ending. But the file it generated was not white right...

So, I tried to fix it. It took a few tries... But! SUCCESS! I got a nice looking slide show. The only adjustment I really needed to make in the end was to the convert command. Here is my final version, and it works great on my AWS hosted CoreOS System online:

#!/usr/bin/env bash

filename=$1

if [ -z $filename ]; then filename=index.md; fi

target=$(basename $filename .md).html

docker exec -it pandoc \
   pandoc --standalone \
          --section-divs \
          --variable theme="beige" \
          --variable transition="linear" \
          -t revealjs \
          -o /slides/$target \
          /slides/$filename

Hope this helps somebody else.

Kevin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.