reveal.rb 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +2 -1
  4. data/Dockerfile +4 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +7 -1
  7. data/README.md +1 -1
  8. data/lib/reveal/command.rb +9 -3
  9. data/lib/reveal/templates/revealjs/css/print/paper.css +4 -3
  10. data/lib/reveal/templates/revealjs/css/print/pdf.css +59 -38
  11. data/lib/reveal/templates/revealjs/css/reveal.css +654 -274
  12. data/lib/reveal/templates/revealjs/css/theme/beige.css +65 -68
  13. data/lib/reveal/templates/revealjs/css/theme/black.css +58 -61
  14. data/lib/reveal/templates/revealjs/css/theme/blood.css +64 -62
  15. data/lib/reveal/templates/revealjs/css/theme/league.css +59 -62
  16. data/lib/reveal/templates/revealjs/css/theme/moon.css +59 -62
  17. data/lib/reveal/templates/revealjs/css/theme/night.css +58 -61
  18. data/lib/reveal/templates/revealjs/css/theme/serif.css +56 -59
  19. data/lib/reveal/templates/revealjs/css/theme/simple.css +60 -60
  20. data/lib/reveal/templates/revealjs/css/theme/sky.css +59 -62
  21. data/lib/reveal/templates/revealjs/css/theme/solarized.css +59 -62
  22. data/lib/reveal/templates/revealjs/css/theme/white.css +59 -62
  23. data/lib/reveal/templates/revealjs/index.html +14 -376
  24. data/lib/reveal/templates/revealjs/js/reveal.js +1073 -342
  25. data/lib/reveal/templates/revealjs/lib/css/zenburn.css +41 -78
  26. data/lib/reveal/templates/revealjs/lib/js/head.min.js +9 -8
  27. data/lib/reveal/templates/revealjs/plugin/highlight/highlight.js +51 -4
  28. data/lib/reveal/templates/revealjs/plugin/markdown/markdown.js +38 -19
  29. data/lib/reveal/templates/revealjs/plugin/markdown/marked.js +1 -1
  30. data/lib/reveal/templates/revealjs/plugin/math/math.js +5 -2
  31. data/lib/reveal/templates/revealjs/plugin/multiplex/client.js +1 -1
  32. data/lib/reveal/templates/revealjs/plugin/multiplex/index.js +24 -16
  33. data/lib/reveal/templates/revealjs/plugin/multiplex/master.js +26 -43
  34. data/lib/reveal/templates/revealjs/plugin/multiplex/package.json +19 -0
  35. data/lib/reveal/templates/revealjs/plugin/notes/notes.html +385 -32
  36. data/lib/reveal/templates/revealjs/plugin/notes/notes.js +39 -6
  37. data/lib/reveal/templates/revealjs/plugin/notes-server/client.js +6 -1
  38. data/lib/reveal/templates/revealjs/plugin/notes-server/index.js +17 -14
  39. data/lib/reveal/templates/revealjs/plugin/notes-server/notes.html +215 -26
  40. data/lib/reveal/templates/revealjs/plugin/print-pdf/print-pdf.js +48 -27
  41. data/lib/reveal/templates/revealjs/plugin/search/search.js +41 -31
  42. data/lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js +17 -23
  43. data/lib/reveal/templates/template.html +12 -41
  44. data/lib/reveal/version.rb +1 -1
  45. data/spec/lib/reveal/command_spec.rb +37 -0
  46. metadata +14 -16
  47. data/lib/reveal/templates/revealjs/lib/font/league-gothic/LICENSE +0 -2
  48. data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/LICENSE +0 -45
  49. data/lib/reveal/templates/revealjs/plugin/leap/leap.js +0 -159
  50. data/lib/reveal/templates/revealjs/plugin/remotes/remotes.js +0 -39
@@ -1,30 +1,27 @@
1
1
  // Custom reveal.js integration
2
2
  (function(){
3
- var isEnabled = true;
3
+ var revealElement = document.querySelector( '.reveal' );
4
+ if( revealElement ) {
4
5
 
5
- document.querySelector( '.reveal .slides' ).addEventListener( 'mousedown', function( event ) {
6
- var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key';
6
+ revealElement.addEventListener( 'mousedown', function( event ) {
7
+ var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
7
8
 
8
- var zoomPadding = 20;
9
- var revealScale = Reveal.getScale();
9
+ var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
10
+ var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
10
11
 
11
- if( event[ modifier ] && isEnabled ) {
12
- event.preventDefault();
12
+ if( event[ modifier ] && !Reveal.isOverview() ) {
13
+ event.preventDefault();
13
14
 
14
- var bounds = event.target.getBoundingClientRect();
15
-
16
- zoom.to({
17
- x: ( bounds.left * revealScale ) - zoomPadding,
18
- y: ( bounds.top * revealScale ) - zoomPadding,
19
- width: ( bounds.width * revealScale ) + ( zoomPadding * 2 ),
20
- height: ( bounds.height * revealScale ) + ( zoomPadding * 2 ),
21
- pan: false
22
- });
23
- }
24
- } );
15
+ zoom.to({
16
+ x: event.clientX,
17
+ y: event.clientY,
18
+ scale: zoomLevel,
19
+ pan: false
20
+ });
21
+ }
22
+ } );
25
23
 
26
- Reveal.addEventListener( 'overviewshown', function() { isEnabled = false; } );
27
- Reveal.addEventListener( 'overviewhidden', function() { isEnabled = true; } );
24
+ }
28
25
  })();
29
26
 
30
27
  /*!
@@ -273,6 +270,3 @@ var zoom = (function(){
273
270
  }
274
271
 
275
272
  })();
276
-
277
-
278
-
@@ -1,23 +1,15 @@
1
1
  <!doctype html>
2
- <html lang="en">
3
-
2
+ <html>
4
3
  <head>
5
4
  <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
6
 
7
- <title>reveal.js - The HTML Presentation Framework</title>
8
-
9
- <meta name="description" content="A framework for easily creating beautiful presentations using HTML">
10
- <meta name="author" content="Hakim El Hattab">
11
-
12
- <meta name="apple-mobile-web-app-capable" content="yes" />
13
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
14
-
15
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
7
+ <title>reveal.js</title>
16
8
 
17
9
  <link rel="stylesheet" href="css/reveal.css">
18
- <link rel="stylesheet" href="css/theme/black.css" id="theme">
10
+ <link rel="stylesheet" href="css/theme/black.css">
19
11
 
20
- <!-- Code syntax highlighting -->
12
+ <!-- Theme used for syntax highlighting of code -->
21
13
  <link rel="stylesheet" href="lib/css/zenburn.css">
22
14
 
23
15
  <!-- Printing and PDF exports -->
@@ -28,50 +20,29 @@
28
20
  link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
29
21
  document.getElementsByTagName( 'head' )[0].appendChild( link );
30
22
  </script>
31
-
32
- <!--[if lt IE 9]>
33
- <script src="lib/js/html5shiv.js"></script>
34
- <![endif]-->
35
23
  </head>
36
-
37
24
  <body>
38
-
39
25
  <div class="reveal">
40
-
41
- <!-- Any section element inside of this container is displayed as a slide -->
42
26
  <div class="slides">
43
27
  <slides>
44
28
  </div>
45
-
46
29
  </div>
47
30
 
48
31
  <script src="lib/js/head.min.js"></script>
49
32
  <script src="js/reveal.js"></script>
50
33
 
51
34
  <script>
52
-
53
- // Full list of configuration options available at:
54
- // https://github.com/hakimel/reveal.js#configuration
35
+ // More info about config & dependencies:
36
+ // - https://github.com/hakimel/reveal.js#configuration
37
+ // - https://github.com/hakimel/reveal.js#dependencies
55
38
  Reveal.initialize({
56
- controls: true,
57
- progress: true,
58
- history: true,
59
- center: true,
60
-
61
- transition: 'slide', // none/fade/slide/convex/concave/zoom
62
-
63
- // Optional reveal.js plugins
64
39
  dependencies: [
65
- { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
66
- { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
67
- { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
68
- { src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
69
- { src: 'plugin/zoom-js/zoom.js', async: true },
70
- { src: 'plugin/notes/notes.js', async: true }
40
+ { src: 'plugin/markdown/marked.js' },
41
+ { src: 'plugin/markdown/markdown.js' },
42
+ { src: 'plugin/notes/notes.js', async: true },
43
+ { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
71
44
  ]
72
45
  });
73
-
74
46
  </script>
75
-
76
47
  </body>
77
48
  </html>
@@ -1,3 +1,3 @@
1
1
  module Reveal
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -89,6 +89,16 @@ describe Reveal::Command do
89
89
 
90
90
  logger.verify
91
91
  end
92
+
93
+ describe 'and slide name already includes ".md" extension' do
94
+ it "doesn't add the extension to the file name" do
95
+ logger.expect(:info, nil, [String])
96
+ subject.add_slide(['new_slide.md'])
97
+
98
+ File.exist?('source/new_slide.md.md').must_equal false
99
+ File.exist?('source/new_slide.md').must_equal true
100
+ end
101
+ end
92
102
  end
93
103
 
94
104
  describe "when the presentation doesn't exist" do
@@ -118,6 +128,20 @@ describe Reveal::Command do
118
128
  output = File.read('output/index.html')
119
129
  output.must_match /^Presentation: .*slide 1 content.*slide 2 content/m
120
130
  end
131
+
132
+ describe 'and a slide name already has extension' do
133
+ before do
134
+ File.write('reveal.yml', { 'slides' => ['slide1.md', 'slide2'] }.to_yaml)
135
+ end
136
+
137
+ it 'Finds the slide file correctly' do
138
+ logger.expect(:info, nil, [String])
139
+ subject.generate
140
+
141
+ output = File.read('output/index.html')
142
+ output.must_match /^Presentation: .*slide 1 content.*slide 2 content/m
143
+ end
144
+ end
121
145
  end
122
146
 
123
147
  describe 'and slides are manually ordered' do
@@ -145,6 +169,19 @@ describe Reveal::Command do
145
169
  output.must_match /^Presentation: .*slide 2 content.*slide 1 content/m
146
170
  end
147
171
  end
172
+
173
+ describe 'and a slide name already has extension' do
174
+ before do
175
+ File.write('reveal.yml', { 'order' => 'manual', 'slides' => ['slide1.md', 'slide2'] }.to_yaml)
176
+ end
177
+
178
+ it 'Finds the slide file correctly' do
179
+ subject.generate
180
+
181
+ output = File.read('output/index.html')
182
+ output.must_match /^Presentation: .*slide 1 content.*slide 2 content/m
183
+ end
184
+ end
148
185
  end
149
186
 
150
187
  it 'logs a success message' do
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reveal.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Garnier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: m
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Generates presentations using reveal.js
@@ -46,9 +46,10 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - .ruby-gemset
50
- - .ruby-version
51
- - .travis.yml
49
+ - ".ruby-gemset"
50
+ - ".ruby-version"
51
+ - ".travis.yml"
52
+ - Dockerfile
52
53
  - Gemfile
53
54
  - Gemfile.lock
54
55
  - LICENSE
@@ -76,12 +77,10 @@ files:
76
77
  - lib/reveal/templates/revealjs/index.html
77
78
  - lib/reveal/templates/revealjs/js/reveal.js
78
79
  - lib/reveal/templates/revealjs/lib/css/zenburn.css
79
- - lib/reveal/templates/revealjs/lib/font/league-gothic/LICENSE
80
80
  - lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.css
81
81
  - lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.eot
82
82
  - lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.ttf
83
83
  - lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.woff
84
- - lib/reveal/templates/revealjs/lib/font/source-sans-pro/LICENSE
85
84
  - lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.eot
86
85
  - lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.ttf
87
86
  - lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.woff
@@ -99,7 +98,6 @@ files:
99
98
  - lib/reveal/templates/revealjs/lib/js/head.min.js
100
99
  - lib/reveal/templates/revealjs/lib/js/html5shiv.js
101
100
  - lib/reveal/templates/revealjs/plugin/highlight/highlight.js
102
- - lib/reveal/templates/revealjs/plugin/leap/leap.js
103
101
  - lib/reveal/templates/revealjs/plugin/markdown/example.html
104
102
  - lib/reveal/templates/revealjs/plugin/markdown/example.md
105
103
  - lib/reveal/templates/revealjs/plugin/markdown/markdown.js
@@ -108,13 +106,13 @@ files:
108
106
  - lib/reveal/templates/revealjs/plugin/multiplex/client.js
109
107
  - lib/reveal/templates/revealjs/plugin/multiplex/index.js
110
108
  - lib/reveal/templates/revealjs/plugin/multiplex/master.js
109
+ - lib/reveal/templates/revealjs/plugin/multiplex/package.json
111
110
  - lib/reveal/templates/revealjs/plugin/notes-server/client.js
112
111
  - lib/reveal/templates/revealjs/plugin/notes-server/index.js
113
112
  - lib/reveal/templates/revealjs/plugin/notes-server/notes.html
114
113
  - lib/reveal/templates/revealjs/plugin/notes/notes.html
115
114
  - lib/reveal/templates/revealjs/plugin/notes/notes.js
116
115
  - lib/reveal/templates/revealjs/plugin/print-pdf/print-pdf.js
117
- - lib/reveal/templates/revealjs/plugin/remotes/remotes.js
118
116
  - lib/reveal/templates/revealjs/plugin/search/search.js
119
117
  - lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js
120
118
  - lib/reveal/templates/template.html
@@ -132,17 +130,17 @@ require_paths:
132
130
  - lib
133
131
  required_ruby_version: !ruby/object:Gem::Requirement
134
132
  requirements:
135
- - - '>='
133
+ - - ">="
136
134
  - !ruby/object:Gem::Version
137
135
  version: '0'
138
136
  required_rubygems_version: !ruby/object:Gem::Requirement
139
137
  requirements:
140
- - - '>='
138
+ - - ">="
141
139
  - !ruby/object:Gem::Version
142
140
  version: '0'
143
141
  requirements: []
144
142
  rubyforge_project:
145
- rubygems_version: 2.2.2
143
+ rubygems_version: 2.7.6
146
144
  signing_key:
147
145
  specification_version: 4
148
146
  summary: reveal.js presentation generator
@@ -1,2 +0,0 @@
1
- SIL Open Font License (OFL)
2
- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
@@ -1,45 +0,0 @@
1
- SIL Open Font License
2
-
3
- Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
4
-
5
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
6
- This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
7
-
8
- —————————————————————————————-
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- —————————————————————————————-
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
14
-
15
- The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
16
-
17
- DEFINITIONS
18
- “Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
19
-
20
- “Reserved Font Name” refers to any names specified as such after the copyright statement(s).
21
-
22
- “Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s).
23
-
24
- “Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
25
-
26
- “Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
27
-
28
- PERMISSION & CONDITIONS
29
- Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
30
-
31
- 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
32
-
33
- 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
34
-
35
- 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
36
-
37
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
38
-
39
- 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
40
-
41
- TERMINATION
42
- This license becomes null and void if any of the above conditions are not met.
43
-
44
- DISCLAIMER
45
- THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.