reveal-ck 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.gitmodules +3 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +16 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +15 -0
  6. data/Gemfile.lock +52 -0
  7. data/LICENSE +20 -0
  8. data/README.md +103 -0
  9. data/Rakefile +16 -0
  10. data/VERSION +1 -0
  11. data/bin/reveal-ck +46 -0
  12. data/features/data/images/ruby100.png +0 -0
  13. data/features/generate.feature +63 -0
  14. data/features/help.feature +18 -0
  15. data/features/step_definitions/file_management_steps.rb +3 -0
  16. data/features/support/env.rb +15 -0
  17. data/features/support/file_management.rb +16 -0
  18. data/lib/reveal-ck.rb +4 -0
  19. data/lib/reveal-ck/file_slicer.rb +23 -0
  20. data/lib/reveal-ck/file_splicer.rb +39 -0
  21. data/lib/reveal-ck/haml_processor.rb +24 -0
  22. data/lib/reveal-ck/version.rb +4 -0
  23. data/rakelib/cucumber.rake +2 -0
  24. data/rakelib/jeweler.rake +12 -0
  25. data/rakelib/presentation.rake +40 -0
  26. data/rakelib/reveal.rake +15 -0
  27. data/rakelib/rspec.rake +5 -0
  28. data/reveal-ck.gemspec +152 -0
  29. data/reveal.js/LICENSE +19 -0
  30. data/reveal.js/README.md +374 -0
  31. data/reveal.js/css/print/paper.css +176 -0
  32. data/reveal.js/css/print/pdf.css +160 -0
  33. data/reveal.js/css/reveal.css +1312 -0
  34. data/reveal.js/css/reveal.min.css +7 -0
  35. data/reveal.js/css/shaders/tile-flip.fs +64 -0
  36. data/reveal.js/css/shaders/tile-flip.vs +141 -0
  37. data/reveal.js/css/theme/README.md +25 -0
  38. data/reveal.js/css/theme/beige.css +163 -0
  39. data/reveal.js/css/theme/default.css +163 -0
  40. data/reveal.js/css/theme/night.css +150 -0
  41. data/reveal.js/css/theme/serif.css +150 -0
  42. data/reveal.js/css/theme/simple.css +152 -0
  43. data/reveal.js/css/theme/sky.css +156 -0
  44. data/reveal.js/css/theme/source/beige.scss +50 -0
  45. data/reveal.js/css/theme/source/default.scss +42 -0
  46. data/reveal.js/css/theme/source/night.scss +35 -0
  47. data/reveal.js/css/theme/source/serif.scss +33 -0
  48. data/reveal.js/css/theme/source/simple.scss +38 -0
  49. data/reveal.js/css/theme/source/sky.scss +41 -0
  50. data/reveal.js/css/theme/template/mixins.scss +29 -0
  51. data/reveal.js/css/theme/template/settings.scss +33 -0
  52. data/reveal.js/css/theme/template/theme.scss +163 -0
  53. data/reveal.js/grunt.js +84 -0
  54. data/reveal.js/index.html +375 -0
  55. data/reveal.js/js/reveal.js +1796 -0
  56. data/reveal.js/js/reveal.min.js +8 -0
  57. data/reveal.js/lib/css/zenburn.css +115 -0
  58. data/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
  59. data/reveal.js/lib/font/league_gothic-webfont.svg +230 -0
  60. data/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
  61. data/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
  62. data/reveal.js/lib/font/league_gothic_license +2 -0
  63. data/reveal.js/lib/js/classList.js +2 -0
  64. data/reveal.js/lib/js/head.min.js +8 -0
  65. data/reveal.js/lib/js/html5shiv.js +7 -0
  66. data/reveal.js/package.json +31 -0
  67. data/reveal.js/plugin/highlight/highlight.js +9 -0
  68. data/reveal.js/plugin/markdown/markdown.js +37 -0
  69. data/reveal.js/plugin/markdown/showdown.js +62 -0
  70. data/reveal.js/plugin/notes-server/client.js +57 -0
  71. data/reveal.js/plugin/notes-server/index.js +58 -0
  72. data/reveal.js/plugin/notes-server/notes.html +139 -0
  73. data/reveal.js/plugin/notes/notes.html +164 -0
  74. data/reveal.js/plugin/notes/notes.js +98 -0
  75. data/reveal.js/plugin/postmessage/example.html +39 -0
  76. data/reveal.js/plugin/postmessage/postmessage.js +42 -0
  77. data/reveal.js/plugin/print-pdf/print-pdf.js +39 -0
  78. data/reveal.js/plugin/remotes/remotes.js +30 -0
  79. data/reveal.js/plugin/zoom-js/zoom.js +251 -0
  80. data/spec/data/haml/basic.haml +7 -0
  81. data/spec/data/html/converted_basic_haml.html +10 -0
  82. data/spec/data/html/reveal-js-index.html +375 -0
  83. data/spec/data/slicer/after_remove +6 -0
  84. data/spec/data/slicer/before_remove +10 -0
  85. data/spec/data/splicer/abcd +4 -0
  86. data/spec/data/splicer/after_insert +14 -0
  87. data/spec/data/splicer/before_insert +10 -0
  88. data/spec/lib/reveal-ck/file_slicer_spec.rb +42 -0
  89. data/spec/lib/reveal-ck/file_splicer_spec.rb +41 -0
  90. data/spec/lib/reveal-ck/haml_processor_spec.rb +38 -0
  91. data/spec/spec_helper.rb +27 -0
  92. metadata +271 -0
@@ -0,0 +1,39 @@
1
+ class FileSplicer
2
+
3
+ def initialize(lines)
4
+ @lines = lines
5
+ end
6
+
7
+ def insert(new_lines, opts)
8
+ index = @lines.each.with_index do |line, i|
9
+ break i + 1 if line.include? opts[:after]
10
+ end
11
+ @lines.insert(index, new_lines).flatten
12
+ end
13
+
14
+ def self.insert!(to_insert, opts)
15
+ to_insert_lines = readlines to_insert
16
+ insert_into_file = find_file opts[:into]
17
+ insert_into_lines = readlines insert_into_file
18
+
19
+ splicer = FileSplicer.new insert_into_lines
20
+ spliced_lines = splicer.insert to_insert_lines, after: opts[:after]
21
+ File.open(insert_into_file, 'w') { |f| f << spliced_lines.join }
22
+ end
23
+
24
+ private
25
+
26
+ def self.find_file(path)
27
+ if File.exists? path
28
+ path
29
+ else
30
+ File.expand_original(File.join(Dir.pwd, to_insert))
31
+ end
32
+ end
33
+
34
+ def self.readlines(path)
35
+ file = find_file path
36
+ File.open(file).readlines
37
+ end
38
+
39
+ end
@@ -0,0 +1,24 @@
1
+ require 'haml'
2
+ require 'ostruct'
3
+
4
+ class HamlProcessor
5
+
6
+ attr_reader :html
7
+
8
+ def initialize(haml)
9
+ render_context = ::OpenStruct.new({})
10
+ engine = ::Haml::Engine.new haml
11
+ @html = engine.render render_context
12
+ end
13
+
14
+ def self.open(path)
15
+ haml_file = if File.exists? path
16
+ path
17
+ else
18
+ File.expand_path(File.join(Dir.pwd, path))
19
+ end
20
+ haml = File.open(haml_file).read
21
+ HamlProcessor.new haml
22
+ end
23
+
24
+ end
@@ -0,0 +1,4 @@
1
+ module RevealCK
2
+ jeweler_version_file = File.expand_path(File.join(__FILE__, '..', '..', '..', 'VERSION'))
3
+ VERSION = File.open(jeweler_version_file).read
4
+ end
@@ -0,0 +1,2 @@
1
+ require 'cucumber/rake/task'
2
+ Cucumber::Rake::Task.new
@@ -0,0 +1,12 @@
1
+ require 'jeweler'
2
+ Jeweler::Tasks.new do |gem|
3
+ gem.name = 'reveal-ck'
4
+ gem.homepage = 'https://github.com/jedcn/reveal-ck'
5
+ gem.license = 'MIT'
6
+ gem.summary = %Q{A toolkit that takes a minimal description of slides and builds a reveal.js presentation}
7
+ gem.description = 'A reveal.js construction kit'
8
+ gem.email = 'northridge@gmail.com'
9
+ gem.authors = ['Jed Northridge']
10
+ gem.files.include 'reveal.js/**/*'
11
+ end
12
+ Jeweler::RubygemsDotOrgTasks.new
@@ -0,0 +1,40 @@
1
+ require 'rake/clean'
2
+
3
+ # FileLists
4
+ DIR_IMAGES_FILES = FileList["images/**/*"]
5
+
6
+ revealjs = File.expand_path(File.join(File.dirname(__FILE__), '..', 'reveal.js'))
7
+ REVEAL_FILES = FileList["#{revealjs}/**/*"]
8
+
9
+ #
10
+ # task: slides
11
+ directory 'slides'
12
+ CLEAN.include 'slides'
13
+
14
+ #
15
+ # task: slides.html
16
+ desc 'Build slides.html'
17
+ file 'slides.html' => 'slides.haml' do
18
+ processor = HamlProcessor.open 'slides.haml'
19
+ File.open('slides.html', 'w') { |f| f << processor.html }
20
+ end
21
+ CLEAN.include 'slides.html'
22
+
23
+ #
24
+ # task: presentation
25
+ desc 'Build presentation'
26
+ task :presentation => [ 'slides', 'slides.html'] do
27
+ cp 'slides.html', 'slides'
28
+ cp_r REVEAL_FILES, 'slides'
29
+ mkdir_p 'slides/images'
30
+ cp_r DIR_IMAGES_FILES, 'slides/images'
31
+ line_nums = {
32
+ default_slides: {
33
+ first: 37,
34
+ last: 338
35
+ }
36
+ }
37
+ default_slides = line_nums[:default_slides][:first]..line_nums[:default_slides][:last]
38
+ FileSlicer.remove! 'slides/index.html', default_slides
39
+ FileSplicer.insert! 'slides.html', into: 'slides/index.html', after: '<div class="slides">'
40
+ end
@@ -0,0 +1,15 @@
1
+ require 'rake/clean'
2
+
3
+ file 'reveal.js/index.html' do
4
+ `git submodule init`
5
+ `git submodule update`
6
+ end
7
+
8
+ CLOBBER.include 'reveal.js'
9
+ task :clobber do
10
+ # Spirit of clobber is to bring repository back to pristine state
11
+ # after cloning. If that's the case, then we want to rm -r reveal.js
12
+ # && mkdir reveal.js. By observation, redefining the task :clobber
13
+ # and adding this mkdir achieves that
14
+ mkdir 'reveal.js'
15
+ end
@@ -0,0 +1,5 @@
1
+ require 'rspec/core'
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new(:spec) do |spec|
4
+ spec.pattern = FileList['spec/**/*_spec.rb']
5
+ end
data/reveal-ck.gemspec ADDED
@@ -0,0 +1,152 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "reveal-ck"
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jed Northridge"]
12
+ s.date = "2013-02-12"
13
+ s.description = "A reveal.js construction kit"
14
+ s.email = "northridge@gmail.com"
15
+ s.executables = ["reveal-ck"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".gitmodules",
22
+ ".rspec",
23
+ ".rvmrc",
24
+ ".travis.yml",
25
+ "Gemfile",
26
+ "Gemfile.lock",
27
+ "LICENSE",
28
+ "README.md",
29
+ "Rakefile",
30
+ "VERSION",
31
+ "bin/reveal-ck",
32
+ "features/data/images/ruby100.png",
33
+ "features/generate.feature",
34
+ "features/help.feature",
35
+ "features/step_definitions/file_management_steps.rb",
36
+ "features/support/env.rb",
37
+ "features/support/file_management.rb",
38
+ "lib/reveal-ck.rb",
39
+ "lib/reveal-ck/file_slicer.rb",
40
+ "lib/reveal-ck/file_splicer.rb",
41
+ "lib/reveal-ck/haml_processor.rb",
42
+ "lib/reveal-ck/version.rb",
43
+ "rakelib/cucumber.rake",
44
+ "rakelib/jeweler.rake",
45
+ "rakelib/presentation.rake",
46
+ "rakelib/reveal.rake",
47
+ "rakelib/rspec.rake",
48
+ "reveal-ck.gemspec",
49
+ "reveal.js/LICENSE",
50
+ "reveal.js/README.md",
51
+ "reveal.js/css/print/paper.css",
52
+ "reveal.js/css/print/pdf.css",
53
+ "reveal.js/css/reveal.css",
54
+ "reveal.js/css/reveal.min.css",
55
+ "reveal.js/css/shaders/tile-flip.fs",
56
+ "reveal.js/css/shaders/tile-flip.vs",
57
+ "reveal.js/css/theme/README.md",
58
+ "reveal.js/css/theme/beige.css",
59
+ "reveal.js/css/theme/default.css",
60
+ "reveal.js/css/theme/night.css",
61
+ "reveal.js/css/theme/serif.css",
62
+ "reveal.js/css/theme/simple.css",
63
+ "reveal.js/css/theme/sky.css",
64
+ "reveal.js/css/theme/source/beige.scss",
65
+ "reveal.js/css/theme/source/default.scss",
66
+ "reveal.js/css/theme/source/night.scss",
67
+ "reveal.js/css/theme/source/serif.scss",
68
+ "reveal.js/css/theme/source/simple.scss",
69
+ "reveal.js/css/theme/source/sky.scss",
70
+ "reveal.js/css/theme/template/mixins.scss",
71
+ "reveal.js/css/theme/template/settings.scss",
72
+ "reveal.js/css/theme/template/theme.scss",
73
+ "reveal.js/grunt.js",
74
+ "reveal.js/index.html",
75
+ "reveal.js/js/reveal.js",
76
+ "reveal.js/js/reveal.min.js",
77
+ "reveal.js/lib/css/zenburn.css",
78
+ "reveal.js/lib/font/league_gothic-webfont.eot",
79
+ "reveal.js/lib/font/league_gothic-webfont.svg",
80
+ "reveal.js/lib/font/league_gothic-webfont.ttf",
81
+ "reveal.js/lib/font/league_gothic-webfont.woff",
82
+ "reveal.js/lib/font/league_gothic_license",
83
+ "reveal.js/lib/js/classList.js",
84
+ "reveal.js/lib/js/head.min.js",
85
+ "reveal.js/lib/js/html5shiv.js",
86
+ "reveal.js/package.json",
87
+ "reveal.js/plugin/highlight/highlight.js",
88
+ "reveal.js/plugin/markdown/markdown.js",
89
+ "reveal.js/plugin/markdown/showdown.js",
90
+ "reveal.js/plugin/notes-server/client.js",
91
+ "reveal.js/plugin/notes-server/index.js",
92
+ "reveal.js/plugin/notes-server/notes.html",
93
+ "reveal.js/plugin/notes/notes.html",
94
+ "reveal.js/plugin/notes/notes.js",
95
+ "reveal.js/plugin/postmessage/example.html",
96
+ "reveal.js/plugin/postmessage/postmessage.js",
97
+ "reveal.js/plugin/print-pdf/print-pdf.js",
98
+ "reveal.js/plugin/remotes/remotes.js",
99
+ "reveal.js/plugin/zoom-js/zoom.js",
100
+ "spec/data/haml/basic.haml",
101
+ "spec/data/html/converted_basic_haml.html",
102
+ "spec/data/html/reveal-js-index.html",
103
+ "spec/data/slicer/after_remove",
104
+ "spec/data/slicer/before_remove",
105
+ "spec/data/splicer/abcd",
106
+ "spec/data/splicer/after_insert",
107
+ "spec/data/splicer/before_insert",
108
+ "spec/lib/reveal-ck/file_slicer_spec.rb",
109
+ "spec/lib/reveal-ck/file_splicer_spec.rb",
110
+ "spec/lib/reveal-ck/haml_processor_spec.rb",
111
+ "spec/spec_helper.rb"
112
+ ]
113
+ s.homepage = "https://github.com/jedcn/reveal-ck"
114
+ s.licenses = ["MIT"]
115
+ s.require_paths = ["lib"]
116
+ s.rubygems_version = "1.8.24"
117
+ s.summary = "A toolkit that takes a minimal description of slides and builds a reveal.js presentation"
118
+
119
+ if s.respond_to? :specification_version then
120
+ s.specification_version = 3
121
+
122
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
123
+ s.add_runtime_dependency(%q<haml>, [">= 0"])
124
+ s.add_runtime_dependency(%q<gli>, [">= 0"])
125
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
126
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
127
+ s.add_development_dependency(%q<rspec>, [">= 0"])
128
+ s.add_development_dependency(%q<bundler>, [">= 0"])
129
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
130
+ s.add_development_dependency(%q<aruba>, [">= 0"])
131
+ else
132
+ s.add_dependency(%q<haml>, [">= 0"])
133
+ s.add_dependency(%q<gli>, [">= 0"])
134
+ s.add_dependency(%q<rake>, [">= 0"])
135
+ s.add_dependency(%q<jeweler>, [">= 0"])
136
+ s.add_dependency(%q<rspec>, [">= 0"])
137
+ s.add_dependency(%q<bundler>, [">= 0"])
138
+ s.add_dependency(%q<cucumber>, [">= 0"])
139
+ s.add_dependency(%q<aruba>, [">= 0"])
140
+ end
141
+ else
142
+ s.add_dependency(%q<haml>, [">= 0"])
143
+ s.add_dependency(%q<gli>, [">= 0"])
144
+ s.add_dependency(%q<rake>, [">= 0"])
145
+ s.add_dependency(%q<jeweler>, [">= 0"])
146
+ s.add_dependency(%q<rspec>, [">= 0"])
147
+ s.add_dependency(%q<bundler>, [">= 0"])
148
+ s.add_dependency(%q<cucumber>, [">= 0"])
149
+ s.add_dependency(%q<aruba>, [">= 0"])
150
+ end
151
+ end
152
+
data/reveal.js/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,374 @@
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 in the Wiki:
9
+ - [Changelog](https://github.com/hakimel/reveal.js/wiki/Changelog): Up-to-date version history.
10
+ - [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
11
+ - [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
12
+
13
+ ## rvl.io
14
+
15
+ Slides are written using HTML or markdown but there's also an online editor for those of you who prefer a more traditional user interface. Give it a try at [www.rvl.io](http://www.rvl.io).
16
+
17
+
18
+ ## Instructions
19
+
20
+ ### Markup
21
+
22
+ Markup heirarchy 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
+ ```html
25
+ <div class="reveal">
26
+ <div class="slides">
27
+ <section>Single Horizontal Slide</section>
28
+ <section>
29
+ <section>Vertical Slide 1</section>
30
+ <section>Vertical Slide 2</section>
31
+ </section>
32
+ </div>
33
+ </div>
34
+ ```
35
+
36
+ ### Markdown
37
+
38
+ 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
+ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish) which in turn uses [showdown](https://github.com/coreyti/showdown/). This is sensitive to indentation (avoid mixing tabs and spaces) and line breaks (avoid consecutive breaks).
41
+
42
+ ```html
43
+ <section data-markdown>
44
+ <script type="text/template">
45
+ ## Page title
46
+
47
+ A paragraph with some text and a [link](http://hakim.se).
48
+ </script>
49
+ </section>
50
+ ```
51
+
52
+ ### Configuration
53
+
54
+ 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
+
56
+ ```javascript
57
+ Reveal.initialize({
58
+ // Display controls in the bottom right corner
59
+ controls: true,
60
+
61
+ // Display a presentation progress bar
62
+ progress: true,
63
+
64
+ // Push each slide change to the browser history
65
+ history: false,
66
+
67
+ // Enable keyboard shortcuts for navigation
68
+ keyboard: true,
69
+
70
+ // Enable the slide overview mode
71
+ overview: true,
72
+
73
+ // Vertical centering of slides
74
+ center: true,
75
+
76
+ // Loop the presentation
77
+ loop: false,
78
+
79
+ // Change the presentation direction to be RTL
80
+ rtl: false,
81
+
82
+ // Number of milliseconds between automatically proceeding to the
83
+ // next slide, disabled when set to 0, this value can be overwritten
84
+ // by using a data-autoslide attribute on your slides
85
+ autoSlide: 0,
86
+
87
+ // Enable slide navigation via mouse wheel
88
+ mouseWheel: false,
89
+
90
+ // Apply a 3D roll to links on hover
91
+ rollingLinks: true,
92
+
93
+ // Transition style
94
+ transition: 'default' // default/cube/page/concave/zoom/linear/fade/none
95
+ });
96
+ ```
97
+
98
+ 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
+
100
+ ### Dependencies
101
+
102
+ 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:
103
+
104
+ ```javascript
105
+ Reveal.initialize({
106
+ dependencies: [
107
+ // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
108
+ { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
109
+
110
+ // Interpret Markdown in <section> elements
111
+ { src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
112
+ { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
113
+
114
+ // Syntax highlight for <code> elements
115
+ { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
116
+
117
+ // Zoom in and out with Alt+click
118
+ { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
119
+
120
+ // Speaker notes
121
+ { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
122
+
123
+ // Remote control your reveal.js presentation using a touch device
124
+ { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
125
+ ]
126
+ });
127
+ ```
128
+
129
+ You can add your own extensions using the same syntax. The following properties are available for each dependency object:
130
+ - **src**: Path to the script to load
131
+ - **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
132
+ - **callback**: [optional] Function to execute when the script has loaded
133
+ - **condition**: [optional] Function which must return true for the script to be loaded
134
+
135
+
136
+ ### API
137
+
138
+ The Reveal class provides a minimal JavaScript API for controlling navigation and reading state:
139
+
140
+ ```javascript
141
+ // Navigation
142
+ Reveal.slide( indexh, indexv, indexf );
143
+ Reveal.left();
144
+ Reveal.right();
145
+ Reveal.up();
146
+ Reveal.down();
147
+ Reveal.prev();
148
+ Reveal.next();
149
+ Reveal.prevFragment();
150
+ Reveal.nextFragment();
151
+ Reveal.toggleOverview();
152
+
153
+ // Retrieves the previous and current slide elements
154
+ Reveal.getPreviousSlide();
155
+ Reveal.getCurrentSlide();
156
+
157
+ Reveal.getIndices(); // { h: 0, v: 0 } }
158
+ ```
159
+
160
+ ### States
161
+
162
+ 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.
163
+
164
+ Furthermore you can also listen to these changes in state via JavaScript:
165
+
166
+ ```javascript
167
+ Reveal.addEventListener( 'somestate', function() {
168
+ // TODO: Sprinkle magic
169
+ }, false );
170
+ ```
171
+
172
+ ### Ready event
173
+
174
+ The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
175
+
176
+ ```javascript
177
+ Reveal.addEventListener( 'ready', function( event ) {
178
+ // event.currentSlide, event.indexh, event.indexv
179
+ } );
180
+ ```
181
+
182
+ ### Slide change event
183
+
184
+ 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
+
186
+ 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.
187
+
188
+ ```javascript
189
+ Reveal.addEventListener( 'slidechanged', function( event ) {
190
+ // event.previousSlide, event.currentSlide, event.indexh, event.indexv
191
+ } );
192
+ ```
193
+
194
+ ### Internal links
195
+
196
+ 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">```):
197
+
198
+ ```html
199
+ <a href="#/2/2">Link</a>
200
+ <a href="#/some-slide">Link</a>
201
+ ```
202
+
203
+ 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.
204
+
205
+ ```html
206
+ <a href="#" class="navigate-left">
207
+ <a href="#" class="navigate-right">
208
+ <a href="#" class="navigate-up">
209
+ <a href="#" class="navigate-down">
210
+ <a href="#" class="navigate-prev"> <!-- Previous vertical or horizontal slide -->
211
+ <a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
212
+ ```
213
+
214
+
215
+ ### Fragments
216
+ Fragments are used to highlight individual elements on a slide. Every elmement 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
+
218
+ 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
+
220
+ ```html
221
+ <section>
222
+ <p class="fragment grow">grow</p>
223
+ <p class="fragment shrink">shrink</p>
224
+ <p class="fragment roll-in">roll-in</p>
225
+ <p class="fragment fade-out">fade-out</p>
226
+ <p class="fragment highlight-red">highlight-red</p>
227
+ <p class="fragment highlight-green">highlight-green</p>
228
+ <p class="fragment highlight-blue">highlight-blue</p>
229
+ </section>
230
+ ```
231
+
232
+ 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.
233
+
234
+ ```html
235
+ <section>
236
+ <span class="fragment fade-in">
237
+ <span class="fragment fade-out">I'll fade in, then out</span>
238
+ </span>
239
+ </section>
240
+ ```
241
+
242
+ ### Fragment events
243
+
244
+ When a slide fragment is either shown or hidden reveal.js will dispatch an event.
245
+
246
+ ```javascript
247
+ Reveal.addEventListener( 'fragmentshown', function( event ) {
248
+ // event.fragment = the fragment DOM element
249
+ } );
250
+ Reveal.addEventListener( 'fragmenthidden', function( event ) {
251
+ // event.fragment = the fragment DOM element
252
+ } );
253
+ ```
254
+
255
+ ### Code syntax higlighting
256
+
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:
258
+
259
+ ```html
260
+ <section>
261
+ <pre><code>
262
+ (def lazy-fib
263
+ (concat
264
+ [0 1]
265
+ ((fn rfib [a b]
266
+ (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
267
+ </code></pre>
268
+ </section>
269
+ ```
270
+
271
+
272
+ ### Overview mode
273
+
274
+ Press "Esc" key to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
275
+ as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
276
+
277
+ ```javascript
278
+ Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );
279
+ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
280
+
281
+ // Toggle the overview mode programmatically
282
+ Reveal.toggleOverview();
283
+ ```
284
+
285
+ ### Fullscreen mode
286
+ Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
287
+
288
+
289
+ ## PDF Export
290
+
291
+ Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
292
+ Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-13872948.
293
+
294
+ 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).
295
+ 2. Open the in-browser print dialog (CMD+P).
296
+ 3. Change the **Destination** setting to **Save as PDF**.
297
+ 4. Change the **Layout** to **Landscape**.
298
+ 5. Change the **Margins** to **None**.
299
+ 6. Click **Save**.
300
+
301
+ ![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
302
+
303
+
304
+ ## Speaker Notes
305
+
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. Append ```?notes``` to presentation URL or press the 's' key on your keyboard to open the notes window.
307
+
308
+ 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
+
310
+ ```html
311
+ <section>
312
+ <h2>Some Slide</h2>
313
+
314
+ <aside class="notes">
315
+ 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).
316
+ </aside>
317
+ </section>
318
+ ```
319
+
320
+ ## Server Side Speaker Nodes
321
+
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 requried scripts by adding the following dependencies:
323
+
324
+ ```javascript
325
+ { src: '/socket.io/socket.io.js', async: true },
326
+ { src: 'plugin/notes-server/client.js', async: true }
327
+ ```
328
+
329
+ Then:
330
+
331
+ 1. Install [Node.js](http://nodejs.org/)
332
+ 2. Run ```npm install```
333
+ 3. Run ```node plugin/notes-server```
334
+
335
+
336
+ ## Theming
337
+
338
+ The framework comes with a few different themes included:
339
+
340
+ - default: Gray background, white text, blue links
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
346
+
347
+ 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:
348
+
349
+ ```html
350
+ <link rel="stylesheet" href="css/theme/default.css" id="theme">
351
+ ```
352
+
353
+ 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).
354
+
355
+
356
+ ## Development Environment
357
+
358
+ reveal.js is built using the task-based command line build tool [grunt.js](http://gruntjs.com) ([installation instructions](https://github.com/gruntjs/grunt#installing-grunt)). With Node.js and grunt.js installed, you need to start by running ```npm install``` in the reveal.js root. When the dependencies have been installed you should run ```grunt watch``` to start monitoring files for changes.
359
+
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
+
362
+ ### Folder Structure
363
+ - **css/** Core styles without which the project does not function
364
+ - **js/** Like above but for JavaScript
365
+ - **plugin/** Components that have been developed as extensions to reveal.js
366
+ - **lib/** All other third party assets (JavaScript, CSS, fonts)
367
+
368
+
369
+ ## License
370
+
371
+ MIT licensed
372
+
373
+ Copyright (C) 2011-2013 Hakim El Hattab, http://hakim.se
374
+