GithubHelp home page GithubHelp logo

rhuss / docker-reveal Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 6.0 5.2 MB

Docker image for creating and serving reveal.js presentation ... special effects included

License: Apache License 2.0

CSS 32.07% Shell 10.49% CoffeeScript 9.01% HTML 43.43% JavaScript 4.51% Emacs Lisp 0.05% C 0.44%

docker-reveal's Introduction

docker-reveal - A Docker image for reveal.js presentations

This docker image is useful for creating reveal.js presentations. It uses the Yeoman generator generator-reveal under the hoods.

Features

  • Based on Alpine Linux
  • Butterfly, a HTML 5 terminal emulation, for inline terminal demos.
  • Docker client
  • Live Reload
  • Java 8 and Maven 3.5.0

Initialization

All your slides will be stored belong a certain directory, referred to $SLIDES from now on. In order to initialize a first simple set of slides (as yo reveal would do) mount $SLIDES into the container and run this image with the option -i:

docker run -ti \
           -p 9000:9000 -p 57575:57575 -p 35729:35729 \
           -v $SLIDES:/slides \
           rhuss/docker-reveal -i

This will copy over a set of slides and start an HTTP server on port 9000. You can visit the demo slides by opening your browser at http://dockerhost:9000/ where dockerhost is the IP address of you docker host (e.g. localhost).

You can now edit the files in $SLIDES. Any change will be picked up immediately and if you have LiveReload installed your browser will refresh immediately.

Creating slides

Slides can be created easily with yo:

docker run -ti \
           -v $SLIDES:/slides \
           rhuss/docker-reveal -n "Slide title" [--markdown|--notes|--attributes]

This can be also done manually:

  • Create a new slide in $SLIDES/slides/, either as HTML (.html) or Markdown (.md) file
  • Add this slide to the list in $SLIDES/slides/list.json

More options are available, please refer to generator-reveal's documentation for details.

Tips

  • If you are using mvn in you demos, you might want to mount your local Maven repository to avoid unnecessary download times. This can be done by adding a -v ~/.m2:/root/.m2 to the Docker command line. Otherwise the container starts up with an empty local repository.
  • In order to access the outer Docker daemon a -v /var/run/docker.sock:/var/run/docker.sock must be added so that the Unix socket is also available within the container. See The Docker Wormhole Pattern for more information.

Finishing up

When you are finished with authoring you can create your own image containing your full presentation. This could also contain the source of your applications which you demo. An example Dockerfile could look like:

FROM rhuss/docker-reveal:latest

# Add presentation slides (add here the $SLIDES dir as source directory
ADD slides/ /

# Optionally checkout your source code and warm it up
RUN cd / && \
    git clone https://github.com/rhuss/docker-maven-sample.git && \
    cd docker-maven-sample && \
    mvn install

8bitdo Zero support

In case you own a 8bitdo Zero and want to use it as remote control, set in you Browser's localStorage (see Developer console) the key use8Bitdo to true. Then you can use the following buttons for the following actions:

Button Action
L Next slide
R Previous slide
Up Up one slide
Down Down one slide
Left Left one slide
Right Right one slide
Select Menu
Start Overview
A Pause (Black)
Y Full Screen

When in menu mode the button mappings is:

Button Action
L Select menu item
Up Up in menu list
Down Down in menu list
Left Left panel
Right Right Panel
Select Leave Menu
A First position in list
Y Last position in list
X Page up in list
Y Page down in list

Gotchas

The terminal emulation works quite nicely but is of course completely insecure with respect to your container. Please keep this in mind. Also, the dynamic sizing of the iframe providing the Butterfly terminal emulation could be improved. I happily will apply pull requests here ;-)

docker-reveal's People

Contributors

rhuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-reveal's Issues

notes.js keeps getting commented out

Everytime index.html is regenerated (new slide, changed slide order) notes.js is commented out.

What is the proper way to get speaker notes with this docker image? Adding with --notes only adds a placeholder, it doesn't change what get's added to index.html.

V1.3 is failing to load resources

Connecting to the webserver on the docker image using http://0.0.0.0:9000 in a browser, result in the following errors in the browser console logs

http://127.0.0.1:9000/bower_components/reveal.js/css/reveal.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/reveal-highlight-themes/styles/solarized_light.css Failed to load resource: the server responded with a status of 404 (Not Found)
2http://127.0.0.1:9000/bower_components/reveal.js/js/reveal.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
(index):767 Uncaught ReferenceError: Reveal is not defined
    at (index):767
http://127.0.0.1:9000/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/reveal.js/css/reveal.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/bower_components/reveal-highlight-themes/styles/solarized_light.css Failed to load resource: the server responded with a status of 404 (Not Found)
5livereload.js?snipver=1:191 WebSocket connection to 'ws://127.0.0.1:35729/livereload' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
__connector.Connector.Connector.connect @ livereload.js?snipver=1:191
(anonymous) @ livereload.js?snipver=1:172
(anonymous) @ livereload.js?snipver=1:292
(anonymous) @ livereload.js?snipver=1:283

Logging into the docker container shows that these files are indeed missing from the bower_components directory

bash.orig-4.3# ls bower_components/
headjs          reveal.js       reveal.js-menu

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.