/gist-reveal

A docker image that helps facilitate open source slideshow authoring by templating gist.github.com content through reveal.js

Primary LanguageJavaScriptMIT LicenseMIT

Gist-Reveal

Build Status Build Status Dependency Check Gitter Chat

![Launch on OpenShift](http://launch-shifter.rhcloud.com/launch/LAUNCH ON.svg)

Gist-Reveal.it is an open source slideshow templating service that makes it easy to create, edit, present, and share Reveal.js slides on the web.

Just store any Revealjs-compatible HTML or Markdown content in a github gist, then add the resulting gist id to the end of any gist-reveal site url to view the resulting templated presentation.

Conference organizers can host their own modified gist-reveal templating service to provide a consistent slideshow theme for all of the presentations at their event:

Application Config

The following environment variables can be used to autoconfigure the application:

Variable Name Contents Default Value
DEFAULT_GIST The default gist id slideshow content for the site af84d40e58c5c2a908dd
GH_CLIENT_SECRET GitHub client secret unset
GH_CLIENT_ID GitHub client ID unset
GA_TRACKER Google Analytics tracker token unset
PORT The server port number 8080
IP_ADDR The server IP address 0.0.0.0
REVEAL_THEME The site's default theme. Should be a locally bundled theme name, or a remote gist_id. 450836bbaebcf4c4ae08b331343a7886
GIST_THEMES Allow reveal.js CSS themes to be installed dynamically "url/?theme=gist_id". Disable this feature by setting this config to the string "false". "true"
REVEAL_SOCKET_SECRET the site's broadcast token (alphanumeric) randomly generated

See plugin/hosted/index.js for more information about the site's configuration options.

Broadcasting Slide Transitions

Administrators can configure the application's REVEAL_SOCKET_SECRET to broadcast slide transitions using Reveal's socket Multiplexing support.

Presenters who know the site's REVEAL_SOCKET_SECRET value can configure their browser as a presentation device using the setToken querystring param:

http://YOUR_REVEAL_HOST_URL/?setToken=REVEAL_SOCKET_SECRET_VALUE

This token will be stored in the browser's localStorage area (per host url) as localStorage.secret. To reconfigure your browser as a client device (as a listener), use the clearToken querystring param:

http://YOUR_REVEAL_HOST_URL/?clearToken

Running Gist-Reveal.it

There are many ways to run Gist-Reveal slideshow templating service. This application should run on OpenShiftV2, OpenShiftV3, Docker, Kubernetes, Heroku, and more.

Local Development

The simplest way to get started with this project, is to clone a copy of the source from github, and run the app locally with npm install followed by npm start.

Docker

To run the docker image locally on port 8080:

docker pull ryanj/gist-reveal
docker run -d -p 8080:8080 ryanj/gist-reveal

Environment variables can be passed into the Docker container in order to configure the websocket relay, or to change the default slideshow content:

docker run -e "REVEAL_SOCKET_SECRET=0P3N-S0URC3" -e "DEFAULT_GIST=YOUR_DEFAULT_GIST_ID" ryanj/gist-reveal

OpenShiftV3

Build from GitHub, using Source2Image:

oc process -v REVEAL_SOCKET_SECRET=1234 -f https://raw.githubusercontent.com/ryanj/gist-reveal/master/gist-reveal-github.json | oc create -f -

Deploy a pre-built image from DockerHub:

oc process -v REVEAL_SOCKET_SECRET=1234 -f https://raw.githubusercontent.com/ryanj/gist-reveal/master/gist-reveal-dockerhub.json | oc create -f -

Or, install one or both of the templates to make these projects easier to launch (from the web, or via oc new-app templatename):

oc create -f https://raw.githubusercontent.com/ryanj/gist-reveal/master/gist-reveal-dockerhub.json
oc create -f https://raw.githubusercontent.com/ryanj/gist-reveal/master/gist-reveal-github.json
oc process gistreveal -v DEFAULT_GIST=${DEFAULT_GIST},GH_CLIENT_ID=${GH_CLIENT_ID},GH_CLIENT_SECRET=${GH_CLIENT_SECRET},REVEAL_SOCKET_SECRET=${REVEAL_SOCKET_SECRET} | oc create -f -

If you are building from GitHub, using S2I, you should be able to trigger a build with the following command:

oc start-build gistreveal

To view the logs for the build, use osc get builds to find its name, and supply that name to the command oc build-logs. For example: oc build-logs gistreveal-1.

OpenShift.com

This application will also run on any OpenShiftV2 cloud using the rhc command-line tool:

rhc app create gistreveal nodejs-0.10 \
--from-code=http://github.com/ryanj/gist-reveal \ 
DEFAULT_GIST=${DEFAULT_GIST} \ 
GH_CLIENT_SECRET=${GH_CLIENT_SECRET} \ 
GH_CLIENT_ID=${GH_CLIENT_ID} \ 
REVEAL_SOCKET_SECRET=0P3N-S0URC3 \ 
GA_TRACKER=YOUR_GA_TRACKER

Or, click here to launch on the web!

Then, use the rhc env set command to publish configuration strings into the application's system environment.

Kubernetes

A sample kubernetes pod configuration file is included for running this project's Docker build on an OriginM5 hosting environment:

export DEFAULT_GIST=YOUR_DEFAULT_GIST_ID 
export GH_CLIENT_SECRET=YOUR_GH_CLIENT_SECRET 
export GH_CLIENT_ID=YOUR_GH_CLIENT_ID
export REVEAL_SOCKET_SECRET=0P3N-S0URC3 
export GA_TRACKER=YOUR_GA_TRACKER
$GOPATH/src/github.com/openshift/origin/_output/go/bin/openshift kubectl create pods -c k8s/reveal-pod.json

License

gist-reveal,it was created at the first DockerCon Hackathon by @ryanj and @fkautz.

Reveal.js is MIT licensed Copyright (C) 2014 Hakim El Hattab, http://hakim.se