This library let's you create slide decks/presentations with Reveal.js and Hoplon, using Clojure + ClojureScript.
If you want to build your own themes, you'll also need:
The latest version is: [hoplon.reveal "0.1.0"]
(defproject your-project "1.2.3"
...
:dependencies [[hoplon.reveal "0.1.0"]
...]
...)
You can then use it in your project like so:
(ns your-project.some-module
(:require [hoplon.reveal :refer
[intro chapter slide notes highlight bullet]]))
...
Although this would allow you to use the Hoplon and hoplon.reveal
functions
and macros, you would still need to add the Reveal.js files. As such, it might
be easier to simply clone this repo and work from there (see the "example
deck").
To get a better sense of how you'd use hoplon.reveal
, here is a complete
slide deck defined in a file called example_deck.cljs.hl
(but compiled to
example-deck.html
):
(page "example-deck.html"
(:require [hoplon.reveal :refer [slideshow]]
[example-deck.chapter1 :as ch1]
[example-deck.chapter2 :as ch2]
[example-deck.chapter3 :as ch3]
[example-deck.chapter4 :as ch4]
[example-deck.chapter5 :as ch5]
[example-deck.chapter6 :as ch6]
[example-deck.chapter7 :as ch7]))
(html
(head)
(body
(slideshow :theme "moon"
(ch1/slides)
(ch2/slides)
(ch3/slides)
(ch4/slides)
(ch5/slides)
(ch6/slides)
(ch7/slides))))
And here's what one of the chapter
s (set of slides) looks like from that
deck:
(chapter :title "HTTP Kit"
(slide :title "A Clojure web server"
(quicklist
"Supports WebSockets and long polling"
"Supports HTTP streaming"
"Compatible with Ring"
"So fast"
"Also a HTTP client"))
(slide :title "Streaming example"
(sample-code/get-http-streaming))
(slide :title "Streaming an OutputStream (part 1)"
(sample-code/get-http-outstream-p1))
(slide :title "Streaming an OutputStream (part 2)"
(sample-code/get-http-outstream-p2))
(slide :title "WebSocket example"
(sample-code/get-http-websocket)
(notes "Note the unified API, allowing us to degrade to long polling")))
We're going to assume that you will develop your slides inside a clone of this repo, for your convenience:
-
Open two terminals in the cloned directory.
-
Start the auto-compiler in one terminal:
$ make watch
-
Run a dev HTTP server in the other terminal:
$ make dev
-
Open the example deck and navigate through it!
-
Check out the beautifully clean source code :-)
-
Create your own slide deck!
You can give your slide deck a feel all your own by following these steps:
-
Install Node.js on your system.
-
Install Grunt:
$ npm install -g grunt-cli
-
Install Saas:
$ gem install sass
-
Change directory:
$ cd resources/assets/reveal.js
-
Install any missing deps for Reveal.js:
$ npm install
-
Duplicate any needed
.scss
file incss/theme/source
. -
Add it to the compilation list in
Gruntfile.js
. -
Add any needed images and update your
.scss
file(s). -
Update any of the
css/theme/template/*.scss
files that you need. -
Run `grunt themes``.
-
Update your hoplon.reveal slideshow to use the new theme, e.g.:
(html (head) (body (slideshow :theme "my-new-theme" ...)))
Copyright © 2014, Clinton N. Dreisbach