reveal-ck 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +13 -0
- data/bin/reveal-ck +23 -8
- data/lib/reveal-ck.rb +6 -0
- data/lib/reveal-ck/build_task.rb +14 -0
- data/lib/reveal-ck/builder.rb +21 -0
- data/lib/reveal-ck/config.rb +43 -0
- data/lib/reveal-ck/file_slicer.rb +19 -17
- data/lib/reveal-ck/file_splicer.rb +30 -28
- data/lib/reveal-ck/file_string_replacer.rb +17 -0
- data/lib/reveal-ck/haml_processor.rb +17 -15
- data/lib/reveal-ck/presentation_builder.rb +69 -0
- data/lib/reveal-ck/slide_builder.rb +66 -0
- data/lib/reveal-ck/version.rb +1 -1
- data/rakelib/cucumber.rake +14 -1
- data/reveal.js/Gruntfile.js +132 -0
- data/reveal.js/LICENSE +1 -1
- data/reveal.js/README.md +362 -50
- data/reveal.js/css/print/paper.css +14 -14
- data/reveal.js/css/print/pdf.css +60 -30
- data/reveal.js/css/reveal.css +444 -149
- data/reveal.js/css/reveal.min.css +2 -2
- data/reveal.js/css/theme/README.md +8 -10
- data/reveal.js/css/theme/beige.css +24 -45
- data/reveal.js/css/theme/default.css +24 -45
- data/reveal.js/css/theme/moon.css +142 -0
- data/reveal.js/css/theme/night.css +24 -44
- data/reveal.js/css/theme/serif.css +27 -45
- data/reveal.js/css/theme/simple.css +25 -45
- data/reveal.js/css/theme/sky.css +26 -43
- data/reveal.js/css/theme/solarized.css +142 -0
- data/reveal.js/css/theme/source/beige.scss +2 -2
- data/reveal.js/css/theme/source/default.scss +2 -2
- data/reveal.js/css/theme/source/moon.scss +68 -0
- data/reveal.js/css/theme/source/night.scss +4 -4
- data/reveal.js/css/theme/source/serif.scss +8 -6
- data/reveal.js/css/theme/source/simple.scss +5 -5
- data/reveal.js/css/theme/source/sky.scss +9 -4
- data/reveal.js/css/theme/source/solarized.scss +74 -0
- data/reveal.js/css/theme/template/settings.scss +2 -2
- data/reveal.js/examples/assets/image1.png +0 -0
- data/reveal.js/examples/assets/image2.png +0 -0
- data/reveal.js/examples/barebones.html +42 -0
- data/reveal.js/examples/embedded-media.html +49 -0
- data/reveal.js/examples/slide-backgrounds.html +101 -0
- data/reveal.js/index.html +63 -56
- data/reveal.js/js/reveal.js +997 -216
- data/reveal.js/js/reveal.min.js +3 -3
- data/reveal.js/package.json +43 -29
- data/reveal.js/plugin/highlight/highlight.js +28 -6
- data/reveal.js/plugin/markdown/example.html +97 -0
- data/reveal.js/plugin/markdown/example.md +29 -0
- data/reveal.js/plugin/markdown/markdown.js +164 -11
- data/reveal.js/plugin/markdown/marked.js +37 -0
- data/reveal.js/plugin/multiplex/client.js +13 -0
- data/reveal.js/plugin/multiplex/index.js +56 -0
- data/reveal.js/plugin/multiplex/master.js +50 -0
- data/reveal.js/plugin/notes-server/index.js +1 -0
- data/reveal.js/plugin/notes-server/notes.html +8 -5
- data/reveal.js/plugin/notes/notes.html +133 -44
- data/reveal.js/plugin/notes/notes.js +3 -1
- data/reveal.js/plugin/print-pdf/print-pdf.js +8 -3
- data/reveal.js/plugin/remotes/remotes.js +13 -4
- data/reveal.js/plugin/search/search.js +196 -0
- data/reveal.js/plugin/zoom-js/zoom.js +26 -21
- data/spec/data/config/config.toml +6 -0
- data/spec/data/string_replacer/after_replace +4 -0
- data/spec/data/string_replacer/before_replace +4 -0
- data/spec/lib/reveal-ck/config_spec.rb +50 -0
- data/spec/lib/reveal-ck/file_slicer_spec.rb +29 -27
- data/spec/lib/reveal-ck/file_splicer_spec.rb +28 -26
- data/spec/lib/reveal-ck/file_string_replacer_spec.rb +32 -0
- data/spec/lib/reveal-ck/haml_processor_spec.rb +28 -26
- metadata +82 -27
- data/rakelib/presentation.rake +0 -41
- data/rakelib/reveal.rake +0 -15
- data/reveal.js/css/shaders/tile-flip.fs +0 -64
- data/reveal.js/css/shaders/tile-flip.vs +0 -141
- data/reveal.js/grunt.js +0 -84
- data/reveal.js/plugin/markdown/showdown.js +0 -62
data/lib/reveal-ck/version.rb
CHANGED
data/rakelib/cucumber.rake
CHANGED
@@ -1,2 +1,15 @@
|
|
1
|
+
require 'cucumber'
|
1
2
|
require 'cucumber/rake/task'
|
2
|
-
|
3
|
+
require 'rake/clean'
|
4
|
+
|
5
|
+
CUKE_RESULTS = 'cucumber_results.html'
|
6
|
+
|
7
|
+
CLEAN << CUKE_RESULTS
|
8
|
+
|
9
|
+
desc 'Run Cucumber'
|
10
|
+
Cucumber::Rake::Task.new(:cucumber) do |t|
|
11
|
+
opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
|
12
|
+
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
|
13
|
+
t.cucumber_opts = opts
|
14
|
+
t.fork = false
|
15
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
/* global module:false */
|
2
|
+
module.exports = function(grunt) {
|
3
|
+
|
4
|
+
// Project configuration
|
5
|
+
grunt.initConfig({
|
6
|
+
pkg: grunt.file.readJSON('package.json'),
|
7
|
+
meta: {
|
8
|
+
banner:
|
9
|
+
'/*!\n' +
|
10
|
+
' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
|
11
|
+
' * http://lab.hakim.se/reveal-js\n' +
|
12
|
+
' * MIT licensed\n' +
|
13
|
+
' *\n' +
|
14
|
+
' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
|
15
|
+
' */'
|
16
|
+
},
|
17
|
+
|
18
|
+
// Tests will be added soon
|
19
|
+
qunit: {
|
20
|
+
files: [ 'test/**/*.html' ]
|
21
|
+
},
|
22
|
+
|
23
|
+
uglify: {
|
24
|
+
options: {
|
25
|
+
banner: '<%= meta.banner %>\n'
|
26
|
+
},
|
27
|
+
build: {
|
28
|
+
src: 'js/reveal.js',
|
29
|
+
dest: 'js/reveal.min.js'
|
30
|
+
}
|
31
|
+
},
|
32
|
+
|
33
|
+
cssmin: {
|
34
|
+
compress: {
|
35
|
+
files: {
|
36
|
+
'css/reveal.min.css': [ 'css/reveal.css' ]
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
|
41
|
+
sass: {
|
42
|
+
main: {
|
43
|
+
files: {
|
44
|
+
'css/theme/default.css': 'css/theme/source/default.scss',
|
45
|
+
'css/theme/beige.css': 'css/theme/source/beige.scss',
|
46
|
+
'css/theme/night.css': 'css/theme/source/night.scss',
|
47
|
+
'css/theme/serif.css': 'css/theme/source/serif.scss',
|
48
|
+
'css/theme/simple.css': 'css/theme/source/simple.scss',
|
49
|
+
'css/theme/sky.css': 'css/theme/source/sky.scss',
|
50
|
+
'css/theme/moon.css': 'css/theme/source/moon.scss',
|
51
|
+
'css/theme/solarized.css': 'css/theme/source/solarized.scss'
|
52
|
+
}
|
53
|
+
}
|
54
|
+
},
|
55
|
+
|
56
|
+
jshint: {
|
57
|
+
options: {
|
58
|
+
curly: false,
|
59
|
+
eqeqeq: true,
|
60
|
+
immed: true,
|
61
|
+
latedef: true,
|
62
|
+
newcap: true,
|
63
|
+
noarg: true,
|
64
|
+
sub: true,
|
65
|
+
undef: true,
|
66
|
+
eqnull: true,
|
67
|
+
browser: true,
|
68
|
+
expr: true,
|
69
|
+
globals: {
|
70
|
+
head: false,
|
71
|
+
module: false,
|
72
|
+
console: false
|
73
|
+
}
|
74
|
+
},
|
75
|
+
files: [ 'Gruntfile.js', 'js/reveal.js' ]
|
76
|
+
},
|
77
|
+
|
78
|
+
connect: {
|
79
|
+
server: {
|
80
|
+
options: {
|
81
|
+
port: 8000,
|
82
|
+
base: '.'
|
83
|
+
}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
|
87
|
+
zip: {
|
88
|
+
'reveal-js-presentation.zip': [
|
89
|
+
'index.html',
|
90
|
+
'css/**',
|
91
|
+
'js/**',
|
92
|
+
'lib/**',
|
93
|
+
'images/**',
|
94
|
+
'plugin/**'
|
95
|
+
]
|
96
|
+
},
|
97
|
+
|
98
|
+
watch: {
|
99
|
+
main: {
|
100
|
+
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
|
101
|
+
tasks: 'default'
|
102
|
+
},
|
103
|
+
theme: {
|
104
|
+
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
|
105
|
+
tasks: 'themes'
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
});
|
110
|
+
|
111
|
+
// Dependencies
|
112
|
+
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
113
|
+
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
|
114
|
+
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
|
115
|
+
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
116
|
+
grunt.loadNpmTasks( 'grunt-contrib-sass' );
|
117
|
+
grunt.loadNpmTasks( 'grunt-contrib-connect' );
|
118
|
+
grunt.loadNpmTasks( 'grunt-zip' );
|
119
|
+
|
120
|
+
// Default task
|
121
|
+
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
|
122
|
+
|
123
|
+
// Theme task
|
124
|
+
grunt.registerTask( 'themes', [ 'sass' ] );
|
125
|
+
|
126
|
+
// Package presentation to archive
|
127
|
+
grunt.registerTask( 'package', [ 'default', 'zip' ] );
|
128
|
+
|
129
|
+
// Serve presentation locally
|
130
|
+
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
|
131
|
+
|
132
|
+
};
|
data/reveal.js/LICENSE
CHANGED
data/reveal.js/README.md
CHANGED
@@ -5,21 +5,22 @@ A framework for easily creating beautiful presentations using HTML. [Check out t
|
|
5
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
6
|
|
7
7
|
|
8
|
-
#### More reading
|
9
|
-
- [
|
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.
|
10
11
|
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
|
11
12
|
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
|
12
13
|
|
13
|
-
##
|
14
|
+
## Slides
|
14
15
|
|
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).
|
16
17
|
|
17
18
|
|
18
19
|
## Instructions
|
19
20
|
|
20
21
|
### Markup
|
21
22
|
|
22
|
-
Markup
|
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:
|
23
24
|
|
24
25
|
```html
|
25
26
|
<div class="reveal">
|
@@ -37,7 +38,7 @@ Markup heirarchy needs to be ``<div class="reveal"> <div class="slides"> <sectio
|
|
37
38
|
|
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.
|
39
40
|
|
40
|
-
This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish)
|
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).
|
41
42
|
|
42
43
|
```html
|
43
44
|
<section data-markdown>
|
@@ -49,12 +50,21 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
|
|
49
50
|
</section>
|
50
51
|
```
|
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.
|
56
|
+
|
57
|
+
```html
|
58
|
+
<section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section>
|
59
|
+
```
|
60
|
+
|
52
61
|
### Configuration
|
53
62
|
|
54
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.
|
55
64
|
|
56
65
|
```javascript
|
57
66
|
Reveal.initialize({
|
67
|
+
|
58
68
|
// Display controls in the bottom right corner
|
59
69
|
controls: true,
|
60
70
|
|
@@ -67,6 +77,9 @@ Reveal.initialize({
|
|
67
77
|
// Enable keyboard shortcuts for navigation
|
68
78
|
keyboard: true,
|
69
79
|
|
80
|
+
// Enable touch events for navigation
|
81
|
+
touch: true,
|
82
|
+
|
70
83
|
// Enable the slide overview mode
|
71
84
|
overview: true,
|
72
85
|
|
@@ -79,7 +92,7 @@ Reveal.initialize({
|
|
79
92
|
// Change the presentation direction to be RTL
|
80
93
|
rtl: false,
|
81
94
|
|
82
|
-
// Number of milliseconds between automatically proceeding to the
|
95
|
+
// Number of milliseconds between automatically proceeding to the
|
83
96
|
// next slide, disabled when set to 0, this value can be overwritten
|
84
97
|
// by using a data-autoslide attribute on your slides
|
85
98
|
autoSlide: 0,
|
@@ -91,12 +104,31 @@ Reveal.initialize({
|
|
91
104
|
rollingLinks: true,
|
92
105
|
|
93
106
|
// Transition style
|
94
|
-
transition: 'default' // default/cube/page/concave/zoom/linear/fade/none
|
107
|
+
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
|
108
|
+
|
109
|
+
// Transition speed
|
110
|
+
transitionSpeed: 'default', // default/fast/slow
|
111
|
+
|
112
|
+
// Transition style for full page backgrounds
|
113
|
+
backgroundTransition: 'default' // default/linear
|
114
|
+
|
95
115
|
});
|
96
116
|
```
|
97
117
|
|
98
118
|
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`.
|
99
119
|
|
120
|
+
|
121
|
+
The configuration can be updated after initialization using the ```configure``` method:
|
122
|
+
|
123
|
+
```javascript
|
124
|
+
// Turn autoSlide off
|
125
|
+
Reveal.configure({ autoSlide: 0 });
|
126
|
+
|
127
|
+
// Start auto-sliding every 5s
|
128
|
+
Reveal.configure({ autoSlide: 5000 });
|
129
|
+
```
|
130
|
+
|
131
|
+
|
100
132
|
### Dependencies
|
101
133
|
|
102
134
|
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:
|
@@ -108,7 +140,7 @@ Reveal.initialize({
|
|
108
140
|
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
109
141
|
|
110
142
|
// Interpret Markdown in <section> elements
|
111
|
-
{ src: 'plugin/markdown/
|
143
|
+
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
112
144
|
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
113
145
|
|
114
146
|
// Syntax highlight for <code> elements
|
@@ -133,9 +165,51 @@ You can add your own extensions using the same syntax. The following properties
|
|
133
165
|
- **condition**: [optional] Function which must return true for the script to be loaded
|
134
166
|
|
135
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
|
+
|
136
210
|
### API
|
137
211
|
|
138
|
-
The Reveal class provides a
|
212
|
+
The ``Reveal`` class provides a JavaScript API for controlling navigation and reading state:
|
139
213
|
|
140
214
|
```javascript
|
141
215
|
// Navigation
|
@@ -149,27 +223,22 @@ Reveal.next();
|
|
149
223
|
Reveal.prevFragment();
|
150
224
|
Reveal.nextFragment();
|
151
225
|
Reveal.toggleOverview();
|
226
|
+
Reveal.togglePause();
|
152
227
|
|
153
228
|
// Retrieves the previous and current slide elements
|
154
229
|
Reveal.getPreviousSlide();
|
155
230
|
Reveal.getCurrentSlide();
|
156
231
|
|
157
232
|
Reveal.getIndices(); // { h: 0, v: 0 } }
|
158
|
-
```
|
159
233
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
```javascript
|
167
|
-
Reveal.addEventListener( 'somestate', function() {
|
168
|
-
// TODO: Sprinkle magic
|
169
|
-
}, false );
|
234
|
+
// State checks
|
235
|
+
Reveal.isFirstSlide();
|
236
|
+
Reveal.isLastSlide();
|
237
|
+
Reveal.isOverview();
|
238
|
+
Reveal.isPaused();
|
170
239
|
```
|
171
240
|
|
172
|
-
### Ready
|
241
|
+
### Ready Event
|
173
242
|
|
174
243
|
The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
|
175
244
|
|
@@ -179,7 +248,7 @@ Reveal.addEventListener( 'ready', function( event ) {
|
|
179
248
|
} );
|
180
249
|
```
|
181
250
|
|
182
|
-
### Slide
|
251
|
+
### Slide Changed Event
|
183
252
|
|
184
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.
|
185
254
|
|
@@ -191,6 +260,54 @@ Reveal.addEventListener( 'slidechanged', function( event ) {
|
|
191
260
|
} );
|
192
261
|
```
|
193
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
|
+
|
194
311
|
### Internal links
|
195
312
|
|
196
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">```):
|
@@ -213,7 +330,7 @@ You can also add relative navigation links, similar to the built in reveal.js co
|
|
213
330
|
|
214
331
|
|
215
332
|
### Fragments
|
216
|
-
Fragments are used to highlight individual elements on a slide. Every
|
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
|
217
334
|
|
218
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:
|
219
336
|
|
@@ -239,6 +356,16 @@ Multiple fragments can be applied to the same element sequentially by wrapping i
|
|
239
356
|
</section>
|
240
357
|
```
|
241
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
|
+
|
242
369
|
### Fragment events
|
243
370
|
|
244
371
|
When a slide fragment is either shown or hidden reveal.js will dispatch an event.
|
@@ -252,13 +379,13 @@ Reveal.addEventListener( 'fragmenthidden', function( event ) {
|
|
252
379
|
} );
|
253
380
|
```
|
254
381
|
|
255
|
-
### Code syntax
|
382
|
+
### Code syntax highlighting
|
256
383
|
|
257
|
-
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
|
384
|
+
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.
|
258
385
|
|
259
386
|
```html
|
260
387
|
<section>
|
261
|
-
<pre><code>
|
388
|
+
<pre><code data-trim>
|
262
389
|
(def lazy-fib
|
263
390
|
(concat
|
264
391
|
[0 1]
|
@@ -286,9 +413,19 @@ Reveal.toggleOverview();
|
|
286
413
|
Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
|
287
414
|
|
288
415
|
|
416
|
+
### Embedded media
|
417
|
+
Embedded HTML5 `<video>`/`<audio>` and YouTube iframes are automatically paused when your navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
|
418
|
+
|
419
|
+
Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
|
420
|
+
|
421
|
+
```html
|
422
|
+
<video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
|
423
|
+
```
|
424
|
+
|
425
|
+
|
289
426
|
## PDF Export
|
290
427
|
|
291
|
-
Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
|
428
|
+
Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
|
292
429
|
Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-13872948.
|
293
430
|
|
294
431
|
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).
|
@@ -300,10 +437,29 @@ Here's an example of an exported presentation that's been uploaded to SlideShare
|
|
300
437
|
|
301
438
|
![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
|
302
439
|
|
440
|
+
## Theming
|
441
|
+
|
442
|
+
The framework comes with a few different themes included:
|
443
|
+
|
444
|
+
- default: Gray background, white text, blue links
|
445
|
+
- beige: Beige background, dark text, brown links
|
446
|
+
- sky: Blue background, thin white text, blue links
|
447
|
+
- night: Black background, thick white text, orange links
|
448
|
+
- serif: Cappuccino background, gray text, brown links
|
449
|
+
- simple: White background, black text, blue links
|
450
|
+
|
451
|
+
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:
|
452
|
+
|
453
|
+
```html
|
454
|
+
<link rel="stylesheet" href="css/theme/default.css" id="theme">
|
455
|
+
```
|
456
|
+
|
457
|
+
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).
|
458
|
+
|
303
459
|
|
304
460
|
## Speaker Notes
|
305
461
|
|
306
|
-
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.
|
462
|
+
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.
|
307
463
|
|
308
464
|
By default notes are written using standard HTML, see below, but you can add a ```data-markdown``` attribute to the ```<aside>``` to write them using Markdown.
|
309
465
|
|
@@ -317,13 +473,19 @@ By default notes are written using standard HTML, see below, but you can add a `
|
|
317
473
|
</section>
|
318
474
|
```
|
319
475
|
|
320
|
-
## Server Side Speaker
|
476
|
+
## Server Side Speaker Notes
|
321
477
|
|
322
|
-
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
|
478
|
+
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:
|
323
479
|
|
324
480
|
```javascript
|
325
|
-
{
|
326
|
-
|
481
|
+
Reveal.initialize({
|
482
|
+
...
|
483
|
+
|
484
|
+
dependencies: [
|
485
|
+
{ src: 'socket.io/socket.io.js', async: true },
|
486
|
+
{ src: 'plugin/notes-server/client.js', async: true }
|
487
|
+
]
|
488
|
+
});
|
327
489
|
```
|
328
490
|
|
329
491
|
Then:
|
@@ -333,31 +495,181 @@ Then:
|
|
333
495
|
3. Run ```node plugin/notes-server```
|
334
496
|
|
335
497
|
|
336
|
-
##
|
498
|
+
## Multiplexing
|
337
499
|
|
338
|
-
The
|
500
|
+
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).
|
339
501
|
|
340
|
-
|
341
|
-
- beige: Beige background, dark text, brown links
|
342
|
-
- sky: Blue background, thin white text, blue links
|
343
|
-
- night: Black background, thick white text, orange links
|
344
|
-
- serif: Cappuccino background, gray text, brown links
|
345
|
-
- simple: White background, black text, blue links
|
502
|
+
The multiplex plugin needs the following 3 things to operate:
|
346
503
|
|
347
|
-
|
504
|
+
1. Master presentation that has control
|
505
|
+
2. Client presentations that follow the master
|
506
|
+
3. Socket.io server to broadcast events from the master to the clients
|
348
507
|
|
349
|
-
|
350
|
-
|
508
|
+
More details:
|
509
|
+
|
510
|
+
#### Master presentation
|
511
|
+
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:
|
512
|
+
|
513
|
+
1. ```npm install node-static```
|
514
|
+
2. ```static```
|
515
|
+
|
516
|
+
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.
|
517
|
+
|
518
|
+
You can then access your master presentation at ```http://localhost:1947```
|
519
|
+
|
520
|
+
Example configuration:
|
521
|
+
```javascript
|
522
|
+
Reveal.initialize({
|
523
|
+
// other options
|
524
|
+
|
525
|
+
multiplex: {
|
526
|
+
// Example values. Generate your own.
|
527
|
+
secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
|
528
|
+
id: '1ea875674b17ca76', // Obtained from socket.io server
|
529
|
+
url: 'revealjs.jit.su:80' // Location of socket.io server
|
530
|
+
},
|
531
|
+
|
532
|
+
// Optional libraries used to extend on reveal.js
|
533
|
+
dependencies: [
|
534
|
+
// other deps
|
535
|
+
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
|
536
|
+
{ src: 'plugin/multiplex/master.js', async: true },
|
537
|
+
|
538
|
+
// and if you want speaker notes
|
539
|
+
{ src: 'plugin/notes-server/client.js', async: true }
|
540
|
+
]
|
541
|
+
});
|
351
542
|
```
|
352
543
|
|
353
|
-
|
544
|
+
#### Client presentation
|
545
|
+
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.
|
546
|
+
|
547
|
+
Example configuration:
|
548
|
+
```javascript
|
549
|
+
Reveal.initialize({
|
550
|
+
// other options
|
551
|
+
|
552
|
+
multiplex: {
|
553
|
+
// Example values. Generate your own.
|
554
|
+
secret: null, // null so the clients do not have control of the master presentation
|
555
|
+
id: '1ea875674b17ca76', // id, obtained from socket.io server
|
556
|
+
url: 'revealjs.jit.su:80' // Location of socket.io server
|
557
|
+
},
|
558
|
+
|
559
|
+
// Optional libraries used to extend on reveal.js
|
560
|
+
dependencies: [
|
561
|
+
// other deps
|
562
|
+
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
|
563
|
+
{ src: 'plugin/multiplex/client.js', async: true }
|
564
|
+
]
|
565
|
+
});
|
566
|
+
```
|
354
567
|
|
568
|
+
#### Socket.io server
|
569
|
+
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:
|
355
570
|
|
356
|
-
|
571
|
+
1. ```npm install```
|
572
|
+
2. ```node plugin/multiplex```
|
357
573
|
|
358
|
-
|
574
|
+
Or you use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su).
|
575
|
+
|
576
|
+
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).
|
577
|
+
|
578
|
+
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.
|
579
|
+
|
580
|
+
##### socket.io server as file static server
|
581
|
+
|
582
|
+
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.)
|
583
|
+
|
584
|
+
Example configuration:
|
585
|
+
```javascript
|
586
|
+
Reveal.initialize({
|
587
|
+
// other options
|
588
|
+
|
589
|
+
multiplex: {
|
590
|
+
// Example values. Generate your own.
|
591
|
+
secret: null, // null so the clients do not have control of the master presentation
|
592
|
+
id: '1ea875674b17ca76', // id, obtained from socket.io server
|
593
|
+
url: 'example.com:80' // Location of your socket.io server
|
594
|
+
},
|
595
|
+
|
596
|
+
// Optional libraries used to extend on reveal.js
|
597
|
+
dependencies: [
|
598
|
+
// other deps
|
599
|
+
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
|
600
|
+
{ src: 'plugin/multiplex/client.js', async: true }
|
601
|
+
]
|
602
|
+
```
|
603
|
+
|
604
|
+
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. ;)
|
605
|
+
|
606
|
+
Example configuration:
|
607
|
+
```javascript
|
608
|
+
Reveal.initialize({
|
609
|
+
// other options
|
610
|
+
|
611
|
+
multiplex: {
|
612
|
+
// Example values. Generate your own.
|
613
|
+
secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
|
614
|
+
id: '1ea875674b17ca76', // Obtained from socket.io server
|
615
|
+
url: 'example.com:80' // Location of your socket.io server
|
616
|
+
},
|
617
|
+
|
618
|
+
// Optional libraries used to extend on reveal.js
|
619
|
+
dependencies: [
|
620
|
+
// other deps
|
621
|
+
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
|
622
|
+
{ src: 'plugin/multiplex/master.js', async: true },
|
623
|
+
{ src: 'plugin/multiplex/client.js', async: true }
|
624
|
+
]
|
625
|
+
});
|
626
|
+
```
|
627
|
+
|
628
|
+
## Installation
|
629
|
+
|
630
|
+
The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features as well as the development tasks needed to make changes to the source.
|
631
|
+
|
632
|
+
### Basic setup
|
633
|
+
|
634
|
+
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.
|
635
|
+
|
636
|
+
1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
|
637
|
+
|
638
|
+
2. Unzip and replace the example contents in index.html with your own
|
639
|
+
|
640
|
+
3. Open index.html in a browser to view it
|
641
|
+
|
642
|
+
|
643
|
+
### Full setup
|
644
|
+
|
645
|
+
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.
|
646
|
+
|
647
|
+
1. Install [Node.js](http://nodejs.org/)
|
648
|
+
|
649
|
+
2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
|
650
|
+
|
651
|
+
4. Clone the reveal.js repository
|
652
|
+
```
|
653
|
+
$ git clone git@github.com:hakimel/reveal.js.git
|
654
|
+
```
|
655
|
+
|
656
|
+
5. Navigate to the reveal.js folder
|
657
|
+
```
|
658
|
+
$ cd reveal.js
|
659
|
+
```
|
660
|
+
|
661
|
+
6. Install dependencies
|
662
|
+
```
|
663
|
+
$ npm install
|
664
|
+
```
|
665
|
+
|
666
|
+
7. Serve the presentation and monitor source files for changes
|
667
|
+
```
|
668
|
+
$ grunt serve
|
669
|
+
```
|
670
|
+
|
671
|
+
8. Open <http://localhost:8000> to view your presentation
|
359
672
|
|
360
|
-
If you want to customise reveal.js without running grunt.js you can alter the HTML to point to the uncompressed source files (css/reveal.css & js/reveal.js).
|
361
673
|
|
362
674
|
### Folder Structure
|
363
675
|
- **css/** Core styles without which the project does not function
|
@@ -366,9 +678,9 @@ If you want to customise reveal.js without running grunt.js you can alter the HT
|
|
366
678
|
- **lib/** All other third party assets (JavaScript, CSS, fonts)
|
367
679
|
|
368
680
|
|
681
|
+
|
369
682
|
## License
|
370
683
|
|
371
684
|
MIT licensed
|
372
685
|
|
373
|
-
Copyright (C)
|
374
|
-
|
686
|
+
Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|