Giter Club home page Giter Club logo

reveal.js-docker's Introduction

reveal.js-docker

Build Status

Docker images providing easier to use, opinionated reveal.js web apps - web-based slides/presentations. See example presentation for a showcase of all features.

Evolution of cloudogu/continuous-delivery-slides. Allows for

  • less cluttered Repos (more slides, less reveal.js)
  • faster startup / builds (don't have to build reveal.js over and over again)
  • easier updates (new version of docker image; no git merge necessary)

Table of contents

How to use

Simplest start

Ships a default presentation:

docker run --rm -p 8080:8080 cloudogu/reveal.js

Presentation is served at http://localhost:8080

Ship your own slides

Have a look at the reveal.js-docker-example.

In a nutshell, just

  • mount your markdown slides to /reveal/docs/slides, e.g.
    -v $(pwd)/docs/slides:/reveal/docs/slides and
  • start container (see bellow)
    - there is also a variant with live-reloading for efficient slide creation.

See also examples.

More options

See index.html pseudo-template to see the effects of the options.

  • Mount additional folders to web server, e.g. like so:
    -v $(pwd)/images:/reveal/images
  • Mount folder containing HTML fragment files (examples) to /resources
    • slides.html โžก๏ธ Customize slides from docs/slides (example).
      Useful if you want to hide slides from printing.
    • additional.js - script executed before initializing reveal.js
    • body-end.html - html injected at the end of HTML <body>
    • footer.html - rendered at the footer (lower left corner) for now only works with cloudogu Themes
  • Optional Env vars:
    • TITLE
    • THEME_CSS
    • SHOW_NOTES_FOR_PRINTING - print speaker notes - defaults to false.
    • ADDITIONAL_REVEAL_OPTIONS - additional reveal.js options
    • ADDITIONAL_PLUGINS - additional reveal.js plugins.
      • e.g. -e ADDITIONAL_PLUGINS="RevealMath"
      • Add the plugin script using ADDITIONAL_SCRIPT, e.g. -e ADDITIONAL_SCRIPT='<script src="plugin/math/math.js"></script>'
      • External plugins have to be mounted or copied to the /reveal folder, e.g. here
        -v $(pwd)/plugin/tagcloud:/reveal/plugin/tagcloud
    • SKIP_TEMPLATING ignores all of the above elements and just launches with the index.html present.
      Useful when mounting your own index.html.

Running/Building containers

Note that reveal.js-docker-example also contains a convenient startup script.

# Development mode (with live reloading for editing the slides)
docker run --rm \
    -v $(pwd)/docs/slides:/reveal/docs/slides \
    -v $(pwd)/scripts/test:/resources \
    -e TITLE='my Title' -e THEME_CSS='cloudogu-black.css' \
    -p 8000:8000 -p 35729:35729 \
    cloudogu/reveal.js:dev

# Production Mode (smaller, more secure, just a static HTML site served by NGINX)
docker run --rm \
    -v $(pwd)/docs/slides:/reveal/docs/slides \
    -v $(pwd)/scripts/test:/resources \
    -e TITLE='my Title' -e THEME_CSS='cloudogu-black.css' \
    -p 8080:8080 \
    cloudogu/reveal.js

You can also build your own productive image:

FROM cloudogu/reveal.js:4.0.2-r3 as base

FROM base as aggregator
USER root
RUN mkdir -p /dist/reveal
COPY . /dist/reveal
RUN mv /dist/reveal/resources/ /dist

FROM base
ENV TITLE='my Title' \
    THEME_CSS='cloudogu-black.css'
COPY --from=aggregator --chown=nginx /dist /

Or if you want to run the container with --read-only file system, you can do the index.html rendering at build time, so no files need to be written at runtime:

FROM cloudogu/reveal.js:4.0.2-r3 as base

FROM base as aggregator
ENV TITLE='myTitle' \
    THEME_CSS='cloudogu-black.css'
USER root
COPY . /reveal
RUN mv /reveal/resources/ /
RUN /scripts/templateIndexHtml

FROM base
ENV SKIP_TEMPLATING='true'
COPY --from=aggregator --chown=nginx /reveal /reveal

You can then start your container like so

docker run --rm -u 1000000:1000000 --read-only -v someTempFileImage:/tmp yourImageName

Index.html pseudo-template

See index.html

Examples

Real Life:

Development

Build Docker Images, from repo root

docker build -t prod .
docker build -t dev --build-arg ENV=dev .

Note: If only one build is required, buildkit would be more efficient. However, prod is failing with buildkit. Try it with export DOCKER_BUILDKIT See this issue

Tests

Docker Image

Build (as described here) and run container as described here.

Script templateIndexHtml

Test script locally (manually for now ๐Ÿ˜ฌ)

# For now manually
CAT_INDEX_HTML='true' RESOURCE_FOLDER='scripts/test' WEB_FOLDER='.' scripts/src/templateIndexHtml

reveal.js-docker's People

Contributors

alexbatista avatar asmod3us avatar aspiers avatar bnjmnt4n avatar burnpanck avatar dandv avatar davidbanham avatar denehyg avatar djsutherland avatar earboxer avatar farosas avatar fghaas avatar gturri avatar hakimel avatar jurca avatar linux-man avatar lordsutch avatar mischah avatar nschonni avatar olivierbloch avatar owenversteeg avatar quilicicf avatar rajgoel avatar rmurphey avatar schnatterer avatar technicalpickles avatar tkaczmarzyk avatar vonc avatar webpro avatar xiaomipatchrom avatar

Watchers

 avatar

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.