danidemi / docker-reveal.js Goto Github PK
View Code? Open in Web Editor NEWA docker container to run your docker-reveal.js based slideshow without headhache.
A docker container to run your docker-reveal.js based slideshow without headhache.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.