slide_hero 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/Guardfile +28 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +161 -0
  8. data/Rakefile +9 -0
  9. data/bin/slidehero +37 -0
  10. data/config.ru +14 -0
  11. data/lib/slide_hero/code.rb +16 -0
  12. data/lib/slide_hero/dsl.rb +10 -0
  13. data/lib/slide_hero/grouped_slides.rb +21 -0
  14. data/lib/slide_hero/list.rb +29 -0
  15. data/lib/slide_hero/list_point.rb +26 -0
  16. data/lib/slide_hero/point.rb +27 -0
  17. data/lib/slide_hero/presentation.rb +36 -0
  18. data/lib/slide_hero/slide.rb +47 -0
  19. data/lib/slide_hero/version.rb +3 -0
  20. data/lib/slide_hero/views/_footer.html.erb +0 -0
  21. data/lib/slide_hero/views/_header.html.erb +0 -0
  22. data/lib/slide_hero/views/code.html.erb +3 -0
  23. data/lib/slide_hero/views/empty.html +12 -0
  24. data/lib/slide_hero/views/grouped_slides.html.erb +5 -0
  25. data/lib/slide_hero/views/layout.html.erb +54 -0
  26. data/lib/slide_hero/views/ordered_list.html.erb +5 -0
  27. data/lib/slide_hero/views/slide.html.erb +6 -0
  28. data/lib/slide_hero/views/unordered_list.html.erb +5 -0
  29. data/lib/slide_hero.rb +15 -0
  30. data/slide_hero.gemspec +29 -0
  31. data/templates/new_presentation.tt +11 -0
  32. data/test/fixtures/testclass.rb +5 -0
  33. data/test/minitest_helper.rb +18 -0
  34. data/test/slide_hero/code_spec.rb +29 -0
  35. data/test/slide_hero/dsl_spec.rb +27 -0
  36. data/test/slide_hero/grouped_slides_spec.rb +29 -0
  37. data/test/slide_hero/list_point_spec.rb +34 -0
  38. data/test/slide_hero/list_spec.rb +49 -0
  39. data/test/slide_hero/point_spec.rb +25 -0
  40. data/test/slide_hero/presentation_spec.rb +56 -0
  41. data/test/slide_hero/slide_spec.rb +147 -0
  42. data/test/slide_hero_spec.rb +15 -0
  43. data/vendor/reveal.js/.gitignore +6 -0
  44. data/vendor/reveal.js/.travis.yml +5 -0
  45. data/vendor/reveal.js/Gruntfile.js +132 -0
  46. data/vendor/reveal.js/LICENSE +19 -0
  47. data/vendor/reveal.js/README.md +798 -0
  48. data/vendor/reveal.js/css/print/paper.css +176 -0
  49. data/vendor/reveal.js/css/print/pdf.css +190 -0
  50. data/vendor/reveal.js/css/reveal.css +1649 -0
  51. data/vendor/reveal.js/css/reveal.min.css +7 -0
  52. data/vendor/reveal.js/css/theme/README.md +23 -0
  53. data/vendor/reveal.js/css/theme/beige.css +142 -0
  54. data/vendor/reveal.js/css/theme/default.css +142 -0
  55. data/vendor/reveal.js/css/theme/moon.css +142 -0
  56. data/vendor/reveal.js/css/theme/night.css +130 -0
  57. data/vendor/reveal.js/css/theme/serif.css +132 -0
  58. data/vendor/reveal.js/css/theme/simple.css +132 -0
  59. data/vendor/reveal.js/css/theme/sky.css +139 -0
  60. data/vendor/reveal.js/css/theme/solarized.css +142 -0
  61. data/vendor/reveal.js/css/theme/source/beige.scss +50 -0
  62. data/vendor/reveal.js/css/theme/source/default.scss +42 -0
  63. data/vendor/reveal.js/css/theme/source/moon.scss +68 -0
  64. data/vendor/reveal.js/css/theme/source/night.scss +35 -0
  65. data/vendor/reveal.js/css/theme/source/serif.scss +35 -0
  66. data/vendor/reveal.js/css/theme/source/simple.scss +38 -0
  67. data/vendor/reveal.js/css/theme/source/sky.scss +46 -0
  68. data/vendor/reveal.js/css/theme/source/solarized.scss +74 -0
  69. data/vendor/reveal.js/css/theme/template/mixins.scss +29 -0
  70. data/vendor/reveal.js/css/theme/template/settings.scss +34 -0
  71. data/vendor/reveal.js/css/theme/template/theme.scss +163 -0
  72. data/vendor/reveal.js/examples/assets/image1.png +0 -0
  73. data/vendor/reveal.js/examples/assets/image2.png +0 -0
  74. data/vendor/reveal.js/examples/barebones.html +42 -0
  75. data/vendor/reveal.js/examples/embedded-media.html +49 -0
  76. data/vendor/reveal.js/examples/math.html +185 -0
  77. data/vendor/reveal.js/examples/slide-backgrounds.html +101 -0
  78. data/vendor/reveal.js/js/reveal.js +2788 -0
  79. data/vendor/reveal.js/js/reveal.min.js +8 -0
  80. data/vendor/reveal.js/lib/css/zenburn.css +115 -0
  81. data/vendor/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
  82. data/vendor/reveal.js/lib/font/league_gothic-webfont.svg +230 -0
  83. data/vendor/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
  84. data/vendor/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
  85. data/vendor/reveal.js/lib/font/league_gothic_license +2 -0
  86. data/vendor/reveal.js/lib/js/classList.js +2 -0
  87. data/vendor/reveal.js/lib/js/head.min.js +8 -0
  88. data/vendor/reveal.js/lib/js/html5shiv.js +7 -0
  89. data/vendor/reveal.js/package.json +45 -0
  90. data/vendor/reveal.js/plugin/highlight/highlight.js +31 -0
  91. data/vendor/reveal.js/plugin/leap/leap.js +157 -0
  92. data/vendor/reveal.js/plugin/markdown/example.html +98 -0
  93. data/vendor/reveal.js/plugin/markdown/example.md +31 -0
  94. data/vendor/reveal.js/plugin/markdown/markdown.js +220 -0
  95. data/vendor/reveal.js/plugin/markdown/marked.js +37 -0
  96. data/vendor/reveal.js/plugin/math/math.js +64 -0
  97. data/vendor/reveal.js/plugin/multiplex/client.js +13 -0
  98. data/vendor/reveal.js/plugin/multiplex/index.js +56 -0
  99. data/vendor/reveal.js/plugin/multiplex/master.js +50 -0
  100. data/vendor/reveal.js/plugin/notes/notes.html +259 -0
  101. data/vendor/reveal.js/plugin/notes/notes.js +78 -0
  102. data/vendor/reveal.js/plugin/notes-server/client.js +57 -0
  103. data/vendor/reveal.js/plugin/notes-server/index.js +59 -0
  104. data/vendor/reveal.js/plugin/notes-server/notes.html +142 -0
  105. data/vendor/reveal.js/plugin/postmessage/example.html +39 -0
  106. data/vendor/reveal.js/plugin/postmessage/postmessage.js +42 -0
  107. data/vendor/reveal.js/plugin/print-pdf/print-pdf.js +44 -0
  108. data/vendor/reveal.js/plugin/remotes/remotes.js +39 -0
  109. data/vendor/reveal.js/plugin/search/search.js +196 -0
  110. data/vendor/reveal.js/plugin/zoom-js/zoom.js +256 -0
  111. metadata +277 -0
@@ -0,0 +1,798 @@
1
+ # reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.png?branch=master)](https://travis-ci.org/hakimel/reveal.js)
2
+
3
+ A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/).
4
+
5
+ reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a browser with support for CSS 3D transforms but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.
6
+
7
+
8
+ #### More reading:
9
+ - [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.
10
+ - [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
11
+ - [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
12
+ - [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
13
+
14
+ ## Slides
15
+
16
+ Presentations are written using HTML or markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slid.es](http://slid.es).
17
+
18
+
19
+ ## Instructions
20
+
21
+ ### Markup
22
+
23
+ Markup hierarchy needs to be ``<div class="reveal"> <div class="slides"> <section>`` where the ``<section>`` represents one slide and can be repeated indefinitely. If you place multiple ``<section>``'s inside of another ``<section>`` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example:
24
+
25
+ ```html
26
+ <div class="reveal">
27
+ <div class="slides">
28
+ <section>Single Horizontal Slide</section>
29
+ <section>
30
+ <section>Vertical Slide 1</section>
31
+ <section>Vertical Slide 2</section>
32
+ </section>
33
+ </div>
34
+ </div>
35
+ ```
36
+
37
+ ### Markdown
38
+
39
+ It's possible to write your slides using Markdown. To enable Markdown, add the ```data-markdown``` attribute to your ```<section>``` elements and wrap the contents in a ```<script type="text/template">``` like the example below.
40
+
41
+ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish) modified to use [marked](https://github.com/chjj/marked) to support [Github Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown). Sensitive to indentation (avoid mixing tabs and spaces) and line breaks (avoid consecutive breaks).
42
+
43
+ ```html
44
+ <section data-markdown>
45
+ <script type="text/template">
46
+ ## Page title
47
+
48
+ A paragraph with some text and a [link](http://hakim.se).
49
+ </script>
50
+ </section>
51
+ ```
52
+
53
+ #### External Markdown
54
+
55
+ You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file.
56
+
57
+ ```html
58
+ <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-notes="^Note:" data-charset="iso-8859-15"></section>
59
+ ```
60
+
61
+ ### Configuration
62
+
63
+ At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below.
64
+
65
+ ```javascript
66
+ Reveal.initialize({
67
+
68
+ // Display controls in the bottom right corner
69
+ controls: true,
70
+
71
+ // Display a presentation progress bar
72
+ progress: true,
73
+
74
+ // Push each slide change to the browser history
75
+ history: false,
76
+
77
+ // Enable keyboard shortcuts for navigation
78
+ keyboard: true,
79
+
80
+ // Enable touch events for navigation
81
+ touch: true,
82
+
83
+ // Enable the slide overview mode
84
+ overview: true,
85
+
86
+ // Vertical centering of slides
87
+ center: true,
88
+
89
+ // Loop the presentation
90
+ loop: false,
91
+
92
+ // Change the presentation direction to be RTL
93
+ rtl: false,
94
+
95
+ // Number of milliseconds between automatically proceeding to the
96
+ // next slide, disabled when set to 0, this value can be overwritten
97
+ // by using a data-autoslide attribute on your slides
98
+ autoSlide: 0,
99
+
100
+ // Enable slide navigation via mouse wheel
101
+ mouseWheel: false,
102
+
103
+ // Transition style
104
+ transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
105
+
106
+ // Transition speed
107
+ transitionSpeed: 'default', // default/fast/slow
108
+
109
+ // Transition style for full page backgrounds
110
+ backgroundTransition: 'default' // default/linear/none
111
+
112
+ });
113
+ ```
114
+
115
+ Note that the new default vertical centering option will break compatibility with slides that were using transitions with backgrounds (`cube` and `page`). To restore the previous behavior, set `center` to `false`.
116
+
117
+
118
+ The configuration can be updated after initialization using the ```configure``` method:
119
+
120
+ ```javascript
121
+ // Turn autoSlide off
122
+ Reveal.configure({ autoSlide: 0 });
123
+
124
+ // Start auto-sliding every 5s
125
+ Reveal.configure({ autoSlide: 5000 });
126
+ ```
127
+
128
+
129
+ ### Dependencies
130
+
131
+ Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example:
132
+
133
+ ```javascript
134
+ Reveal.initialize({
135
+ dependencies: [
136
+ // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
137
+ { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
138
+
139
+ // Interpret Markdown in <section> elements
140
+ { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
141
+ { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
142
+
143
+ // Syntax highlight for <code> elements
144
+ { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
145
+
146
+ // Zoom in and out with Alt+click
147
+ { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
148
+
149
+ // Speaker notes
150
+ { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
151
+
152
+ // Remote control your reveal.js presentation using a touch device
153
+ { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } },
154
+
155
+ // MathJax
156
+ { src: 'plugin/math/math.js', async: true }
157
+ ]
158
+ });
159
+ ```
160
+
161
+ You can add your own extensions using the same syntax. The following properties are available for each dependency object:
162
+ - **src**: Path to the script to load
163
+ - **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
164
+ - **callback**: [optional] Function to execute when the script has loaded
165
+ - **condition**: [optional] Function which must return true for the script to be loaded
166
+
167
+
168
+ ### Presentation Size
169
+
170
+ All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport.
171
+
172
+ See below for a list of configuration options related to sizing, including default values:
173
+
174
+ ```javascript
175
+ Reveal.initialize({
176
+
177
+ ...
178
+
179
+ // The "normal" size of the presentation, aspect ratio will be preserved
180
+ // when the presentation is scaled to fit different resolutions. Can be
181
+ // specified using percentage units.
182
+ width: 960,
183
+ height: 700,
184
+
185
+ // Factor of the display size that should remain empty around the content
186
+ margin: 0.1,
187
+
188
+ // Bounds for smallest/largest possible scale to apply to content
189
+ minScale: 0.2,
190
+ maxScale: 1.0
191
+
192
+ });
193
+ ```
194
+
195
+ ### Keyboard Bindings
196
+
197
+ If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
198
+
199
+ ```javascript
200
+ Reveal.configure({
201
+ keyboard: {
202
+ 13: 'next', // go to the next slide when the ENTER key is pressed
203
+ 27: function() {}, // do something custom when ESC is pressed
204
+ 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)
205
+ }
206
+ });
207
+ ```
208
+
209
+
210
+ ### API
211
+
212
+ The ``Reveal`` class provides a JavaScript API for controlling navigation and reading state:
213
+
214
+ ```javascript
215
+ // Navigation
216
+ Reveal.slide( indexh, indexv, indexf );
217
+ Reveal.left();
218
+ Reveal.right();
219
+ Reveal.up();
220
+ Reveal.down();
221
+ Reveal.prev();
222
+ Reveal.next();
223
+ Reveal.prevFragment();
224
+ Reveal.nextFragment();
225
+ Reveal.toggleOverview();
226
+ Reveal.togglePause();
227
+
228
+ // Retrieves the previous and current slide elements
229
+ Reveal.getPreviousSlide();
230
+ Reveal.getCurrentSlide();
231
+
232
+ Reveal.getIndices(); // { h: 0, v: 0 } }
233
+
234
+ // State checks
235
+ Reveal.isFirstSlide();
236
+ Reveal.isLastSlide();
237
+ Reveal.isOverview();
238
+ Reveal.isPaused();
239
+ ```
240
+
241
+ ### Ready Event
242
+
243
+ The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
244
+
245
+ ```javascript
246
+ Reveal.addEventListener( 'ready', function( event ) {
247
+ // event.currentSlide, event.indexh, event.indexv
248
+ } );
249
+ ```
250
+
251
+ ### Slide Changed Event
252
+
253
+ An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
254
+
255
+ Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback.
256
+
257
+ ```javascript
258
+ Reveal.addEventListener( 'slidechanged', function( event ) {
259
+ // event.previousSlide, event.currentSlide, event.indexh, event.indexv
260
+ } );
261
+ ```
262
+
263
+
264
+ ### States
265
+
266
+ If you set ``data-state="somestate"`` on a slide ``<section>``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
267
+
268
+ Furthermore you can also listen to these changes in state via JavaScript:
269
+
270
+ ```javascript
271
+ Reveal.addEventListener( 'somestate', function() {
272
+ // TODO: Sprinkle magic
273
+ }, false );
274
+ ```
275
+
276
+ ### Slide Backgrounds
277
+
278
+ Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page background colors or images by applying a ```data-background``` attribute to your ```<section>``` elements. Below are a few examples.
279
+
280
+ ```html
281
+ <section data-background="#ff0000">
282
+ <h2>All CSS color formats are supported, like rgba() or hsl().</h2>
283
+ </section>
284
+ <section data-background="http://example.com/image.png">
285
+ <h2>This slide will have a full-size background image.</h2>
286
+ </section>
287
+ <section data-background="http://example.com/image.png" data-background-size="100px" data-background-repeat="repeat">
288
+ <h2>This background image will be sized to 100px and repeated.</h2>
289
+ </section>
290
+ ```
291
+
292
+ Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition.
293
+
294
+
295
+ ### Slide Transitions
296
+ The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute:
297
+
298
+ ```html
299
+ <section data-transition="zoom">
300
+ <h2>This slide will override the presentation transition and zoom!</h2>
301
+ </section>
302
+
303
+ <section data-transition-speed="fast">
304
+ <h2>Choose from three transition speeds: default, fast or slow!</h2>
305
+ </section>
306
+ ```
307
+
308
+ Note that this does not work with the page and cube transitions.
309
+
310
+
311
+ ### Internal links
312
+
313
+ It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```<section id="some-slide">```):
314
+
315
+ ```html
316
+ <a href="#/2/2">Link</a>
317
+ <a href="#/some-slide">Link</a>
318
+ ```
319
+
320
+ You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide.
321
+
322
+ ```html
323
+ <a href="#" class="navigate-left">
324
+ <a href="#" class="navigate-right">
325
+ <a href="#" class="navigate-up">
326
+ <a href="#" class="navigate-down">
327
+ <a href="#" class="navigate-prev"> <!-- Previous vertical or horizontal slide -->
328
+ <a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
329
+ ```
330
+
331
+
332
+ ### Fragments
333
+ Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/16
334
+
335
+ The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:
336
+
337
+ ```html
338
+ <section>
339
+ <p class="fragment grow">grow</p>
340
+ <p class="fragment shrink">shrink</p>
341
+ <p class="fragment roll-in">roll-in</p>
342
+ <p class="fragment fade-out">fade-out</p>
343
+ <p class="fragment highlight-red">highlight-red</p>
344
+ <p class="fragment highlight-green">highlight-green</p>
345
+ <p class="fragment highlight-blue">highlight-blue</p>
346
+ </section>
347
+ ```
348
+
349
+ Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second.
350
+
351
+ ```html
352
+ <section>
353
+ <span class="fragment fade-in">
354
+ <span class="fragment fade-out">I'll fade in, then out</span>
355
+ </span>
356
+ </section>
357
+ ```
358
+
359
+ The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
360
+
361
+ ```html
362
+ <section>
363
+ <p class="fragment" data-fragment-index="3">Appears last</p>
364
+ <p class="fragment" data-fragment-index="1">Appears first</p>
365
+ <p class="fragment" data-fragment-index="2">Appears second</p>
366
+ </section>
367
+ ```
368
+
369
+ ### Fragment events
370
+
371
+ When a slide fragment is either shown or hidden reveal.js will dispatch an event.
372
+
373
+ Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback.
374
+
375
+ ```javascript
376
+ Reveal.addEventListener( 'fragmentshown', function( event ) {
377
+ // event.fragment = the fragment DOM element
378
+ } );
379
+ Reveal.addEventListener( 'fragmenthidden', function( event ) {
380
+ // event.fragment = the fragment DOM element
381
+ } );
382
+ ```
383
+
384
+ ### Code syntax highlighting
385
+
386
+ By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed.
387
+
388
+ ```html
389
+ <section>
390
+ <pre><code data-trim>
391
+ (def lazy-fib
392
+ (concat
393
+ [0 1]
394
+ ((fn rfib [a b]
395
+ (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
396
+ </code></pre>
397
+ </section>
398
+ ```
399
+
400
+
401
+ ### Overview mode
402
+
403
+ Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
404
+ as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
405
+
406
+ ```javascript
407
+ Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );
408
+ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
409
+
410
+ // Toggle the overview mode programmatically
411
+ Reveal.toggleOverview();
412
+ ```
413
+
414
+ ### Fullscreen mode
415
+ Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
416
+
417
+
418
+ ### Embedded media
419
+ Embedded HTML5 `<video>`/`<audio>` and YouTube iframes are automatically paused when you navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
420
+
421
+ Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
422
+
423
+ ```html
424
+ <video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
425
+ ```
426
+
427
+
428
+ ### Stretching elements
429
+ Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the ```.stretch``` class to an element as seen below:
430
+
431
+ ```html
432
+ <section>
433
+ <h2>This video will use up the remaining space on the slide</h2>
434
+ <video class="stretch" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
435
+ </section>
436
+ ```
437
+
438
+ Limitations:
439
+ - Only direct descendants of a slide section can be stretched
440
+ - Only one descendant per slide section can be stretched
441
+
442
+
443
+ ## PDF Export
444
+
445
+ Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
446
+ Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-13872948.
447
+
448
+ 1. Open your presentation with [css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css) included on the page. The default index HTML lets you add *print-pdf* anywhere in the query to include the stylesheet, for example: [lab.hakim.se/reveal-js?print-pdf](http://lab.hakim.se/reveal-js?print-pdf).
449
+ 2. Open the in-browser print dialog (CMD+P).
450
+ 3. Change the **Destination** setting to **Save as PDF**.
451
+ 4. Change the **Layout** to **Landscape**.
452
+ 5. Change the **Margins** to **None**.
453
+ 6. Click **Save**.
454
+
455
+ ![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
456
+
457
+ ## Theming
458
+
459
+ The framework comes with a few different themes included:
460
+
461
+ - default: Gray background, white text, blue links
462
+ - beige: Beige background, dark text, brown links
463
+ - sky: Blue background, thin white text, blue links
464
+ - night: Black background, thick white text, orange links
465
+ - serif: Cappuccino background, gray text, brown links
466
+ - simple: White background, black text, blue links
467
+
468
+ Each theme is available as a separate stylesheet. To change theme you will need to replace **default** below with your desired theme name in index.html:
469
+
470
+ ```html
471
+ <link rel="stylesheet" href="css/theme/default.css" id="theme">
472
+ ```
473
+
474
+ If you want to add a theme of your own see the instructions here: [/css/theme/README.md](https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md).
475
+
476
+
477
+ ## Speaker Notes
478
+
479
+ reveal.js comes with a speaker notes plugin which can be used to present per-slide notes in a separate browser window. The notes window also gives you a preview of the next upcoming slide so it may be helpful even if you haven't written any notes. Press the 's' key on your keyboard to open the notes window.
480
+
481
+ Notes are defined by appending an ```<aside>``` element to a slide as seen below. You can add the ```data-markdown``` attribute to the aside element if you prefer writing notes using Markdown.
482
+
483
+ ```html
484
+ <section>
485
+ <h2>Some Slide</h2>
486
+
487
+ <aside class="notes">
488
+ Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
489
+ </aside>
490
+ </section>
491
+ ```
492
+
493
+ If you're using the external Markdown plugin, you can add notes with the help of a special delimiter:
494
+
495
+ ```html
496
+ <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-notes="^Note:"></section>
497
+
498
+ # Title
499
+ ## Sub-title
500
+
501
+ Here is some content...
502
+
503
+ Note:
504
+ This will only display in the notes window.
505
+ ```
506
+
507
+ ## Server Side Speaker Notes
508
+
509
+ In some cases it can be desirable to run notes on a separate device from the one you're presenting on. The Node.js-based notes plugin lets you do this using the same note definitions as its client side counterpart. Include the required scripts by adding the following dependencies:
510
+
511
+ ```javascript
512
+ Reveal.initialize({
513
+ ...
514
+
515
+ dependencies: [
516
+ { src: 'socket.io/socket.io.js', async: true },
517
+ { src: 'plugin/notes-server/client.js', async: true }
518
+ ]
519
+ });
520
+ ```
521
+
522
+ Then:
523
+
524
+ 1. Install [Node.js](http://nodejs.org/)
525
+ 2. Run ```npm install```
526
+ 3. Run ```node plugin/notes-server```
527
+
528
+
529
+ ## Multiplexing
530
+
531
+ The multiplex plugin allows your audience to view the slides of the presentation you are controlling on their own phone, tablet or laptop. As the master presentation navigates the slides, all client presentations will update in real time. See a demo at [http://revealjs.jit.su/](http://revealjs.jit.su).
532
+
533
+ The multiplex plugin needs the following 3 things to operate:
534
+
535
+ 1. Master presentation that has control
536
+ 2. Client presentations that follow the master
537
+ 3. Socket.io server to broadcast events from the master to the clients
538
+
539
+ More details:
540
+
541
+ #### Master presentation
542
+ Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation:
543
+
544
+ 1. ```npm install node-static```
545
+ 2. ```static```
546
+
547
+ If you want to use the speaker notes plugin with your master presentation then make sure you have the speaker notes plugin configured correctly along with the configuration shown below, then execute ```node plugin/notes-server``` in the directory of your master presentation. The configuration below will cause it to connect to the socket.io server as a master, as well as launch your speaker-notes/static-file server.
548
+
549
+ You can then access your master presentation at ```http://localhost:1947```
550
+
551
+ Example configuration:
552
+ ```javascript
553
+ Reveal.initialize({
554
+ // other options...
555
+
556
+ multiplex: {
557
+ // Example values. To generate your own, see the socket.io server instructions.
558
+ secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
559
+ id: '1ea875674b17ca76', // Obtained from socket.io server
560
+ url: 'revealjs.jit.su:80' // Location of socket.io server
561
+ },
562
+
563
+ // Don't forget to add the dependencies
564
+ dependencies: [
565
+ { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
566
+ { src: 'plugin/multiplex/master.js', async: true },
567
+
568
+ // and if you want speaker notes
569
+ { src: 'plugin/notes-server/client.js', async: true }
570
+
571
+ // other dependencies...
572
+ ]
573
+ });
574
+ ```
575
+
576
+ #### Client presentation
577
+ Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via ```http://example.com/path/to/presentation/client/index.html```, with the configuration below causing them to connect to the socket.io server as clients.
578
+
579
+ Example configuration:
580
+ ```javascript
581
+ Reveal.initialize({
582
+ // other options...
583
+
584
+ multiplex: {
585
+ // Example values. To generate your own, see the socket.io server instructions.
586
+ secret: null, // null so the clients do not have control of the master presentation
587
+ id: '1ea875674b17ca76', // id, obtained from socket.io server
588
+ url: 'revealjs.jit.su:80' // Location of socket.io server
589
+ },
590
+
591
+ // Don't forget to add the dependencies
592
+ dependencies: [
593
+ { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
594
+ { src: 'plugin/multiplex/client.js', async: true }
595
+
596
+ // other dependencies...
597
+ ]
598
+ });
599
+ ```
600
+
601
+ #### Socket.io server
602
+ Server that receives the slideChanged events from the master presentation and broadcasts them out to the connected client presentations. This needs to be publicly accessible. You can run your own socket.io server with the commands:
603
+
604
+ 1. ```npm install```
605
+ 2. ```node plugin/multiplex```
606
+
607
+ Or you use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su).
608
+
609
+ You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su), visit [http://revealjs.jit.su/token](http://revealjs.jit.su/token).
610
+
611
+ You are very welcome to point your presentations at the Socket.io server running at [http://revealjs.jit.su](http://revealjs.jit.su), but availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu, heroku, your own environment, etc.
612
+
613
+ ##### socket.io server as file static server
614
+
615
+ The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs.jit.su](http://revealjs.jit.su). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match.)
616
+
617
+ Example configuration:
618
+ ```javascript
619
+ Reveal.initialize({
620
+ // other options...
621
+
622
+ multiplex: {
623
+ // Example values. To generate your own, see the socket.io server instructions.
624
+ secret: null, // null so the clients do not have control of the master presentation
625
+ id: '1ea875674b17ca76', // id, obtained from socket.io server
626
+ url: 'example.com:80' // Location of your socket.io server
627
+ },
628
+
629
+ // Don't forget to add the dependencies
630
+ dependencies: [
631
+ { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
632
+ { src: 'plugin/multiplex/client.js', async: true }
633
+
634
+ // other dependencies...
635
+ ]
636
+ ```
637
+
638
+ It can also play the role of static file server for your master presentation and client presentations at the same time (as long as you don't want to use speaker notes). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match. Navigate through the slides on the second, and the first will update to match.) This is probably not desirable, because you don't want your audience to mess with your slides while you're presenting. ;)
639
+
640
+ Example configuration:
641
+ ```javascript
642
+ Reveal.initialize({
643
+ // other options...
644
+
645
+ multiplex: {
646
+ // Example values. To generate your own, see the socket.io server instructions.
647
+ secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
648
+ id: '1ea875674b17ca76', // Obtained from socket.io server
649
+ url: 'example.com:80' // Location of your socket.io server
650
+ },
651
+
652
+ // Don't forget to add the dependencies
653
+ dependencies: [
654
+ { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
655
+ { src: 'plugin/multiplex/master.js', async: true },
656
+ { src: 'plugin/multiplex/client.js', async: true }
657
+
658
+ // other dependencies...
659
+ ]
660
+ });
661
+ ```
662
+
663
+ ## Leap Motion
664
+ The Leap Motion plugin lets you utilize your [Leap Motion](https://www.leapmotion.com/) device to control basic navigation of your presentation. The gestures currently supported are:
665
+
666
+ ##### 1 to 2 fingers
667
+ * Pointer &mdash; Point to anything on screen. Move your finger past the device to expand the pointer.
668
+
669
+ ##### 1 hand + 3 or more fingers
670
+
671
+ * Left
672
+ * Right
673
+ * Up
674
+ * down
675
+
676
+ Navigate through your slides. See config options to invert movements.
677
+
678
+ ##### 2 hands
679
+ * Up
680
+
681
+ Toggle the overview mode. Do it a second time to exit the overview.
682
+
683
+ #### Config Options
684
+ You can edit the following options:
685
+ * autoCenter: Defaults to true. Center the pointer based on where you put your finger into the leap motions detection field.
686
+ * gestureDelay: Defaults to 500. How long to delay between gestures in milliseconds.
687
+ * naturalSwipe: Defaults to true. Swipe as though you were touching a touch screen. Set to false to invert.
688
+ * pointerColor: Defaults to #00aaff. The color of the pointer.
689
+ * pointerOpacity: Defaults to 0.7. The opacity of the pointer.
690
+ * pointerSize: Defaults to 15. The minimum height and width of the pointer.
691
+ * pointerTolerance: Defaults to 120. Bigger = slower pointer.
692
+
693
+ Example configuration:
694
+ ```js
695
+ Reveal.initialize({
696
+
697
+ // other options...
698
+
699
+ leap: {
700
+ naturalSwipe : false, // Invert swipe gestures
701
+ pointerOpacity : 0.5, // Set pointer opacity to 0.5
702
+ pointerColor : '#d80000' // Red pointer
703
+ },
704
+
705
+ dependencies: [
706
+ { src: 'plugin/leap/leap.js', async: true }
707
+ ]
708
+
709
+ });
710
+ ```
711
+
712
+ ## MathJax
713
+
714
+ If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies).
715
+
716
+ The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value.
717
+
718
+ Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the ```math``` config object at all.
719
+
720
+ ```js
721
+ Reveal.initialize({
722
+
723
+ // other options ...
724
+
725
+ math: {
726
+ mathjax: 'http://cdn.mathjax.org/mathjax/latest/MathJax.js',
727
+ config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
728
+ },
729
+
730
+ dependencies: [
731
+ { src: 'plugin/math/math.js', async: true }
732
+ ]
733
+
734
+ });
735
+ ```
736
+
737
+ Read MathJax's documentation if you want [secure delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serve [specific versons](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stabilty.
738
+
739
+
740
+ ## Installation
741
+
742
+ The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features and plugins such as speaker notes as well as the development tasks needed to make changes to the source.
743
+
744
+ ### Basic setup
745
+
746
+ The core of reveal.js is very easy to install. You'll simply need to download a copy of this repository and open the index.html file directly in your browser.
747
+
748
+ 1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
749
+
750
+ 2. Unzip and replace the example contents in index.html with your own
751
+
752
+ 3. Open index.html in a browser to view it
753
+
754
+
755
+ ### Full setup
756
+
757
+ Some reveal.js features, like external markdown, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
758
+
759
+ 1. Install [Node.js](http://nodejs.org/)
760
+
761
+ 2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
762
+
763
+ 4. Clone the reveal.js repository
764
+ ```
765
+ $ git clone git@github.com:hakimel/reveal.js.git
766
+ ```
767
+
768
+ 5. Navigate to the reveal.js folder
769
+ ```
770
+ $ cd reveal.js
771
+ ```
772
+
773
+ 6. Install dependencies
774
+ ```
775
+ $ npm install
776
+ ```
777
+
778
+ 7. Serve the presentation and monitor source files for changes
779
+ ```
780
+ $ grunt serve
781
+ ```
782
+
783
+ 8. Open <http://localhost:8000> to view your presentation
784
+
785
+
786
+ ### Folder Structure
787
+ - **css/** Core styles without which the project does not function
788
+ - **js/** Like above but for JavaScript
789
+ - **plugin/** Components that have been developed as extensions to reveal.js
790
+ - **lib/** All other third party assets (JavaScript, CSS, fonts)
791
+
792
+
793
+
794
+ ## License
795
+
796
+ MIT licensed
797
+
798
+ Copyright (C) 2013 Hakim El Hattab, http://hakim.se