deckrb 0.3.1 → 0.4.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.
data/README.md CHANGED
@@ -26,6 +26,7 @@ Put this in a file named `meals.md`:
26
26
 
27
27
  # Dinner
28
28
  > "To eat is to live." -Anon.
29
+ <!VIDEO u1zgFlCw8Aw>
29
30
 
30
31
  then run this:
31
32
 
@@ -36,7 +37,7 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
36
37
  * One titled "Breakfast" with three bullet points
37
38
  * One titled "Lunch" with three H2 headers ("Lunch", "Ham Sandwich", and "Caesar Salad")
38
39
  * One with no headers, just a picture (stored in the same directory as `meals.md`)
39
- * One titled "Dinner" with a blockquote
40
+ * One titled "Dinner" with a blockquote and an embedded youtube video player
40
41
 
41
42
  ## Details
42
43
 
@@ -81,10 +82,18 @@ and you'll get a web server running on `http://localhost:4333` serving up a slid
81
82
  --version, -v: Print version and exit
82
83
  --help, -h: Show this message
83
84
 
84
- ## Known Issues
85
+ ## Known Issues (Bugs and Limitations)
85
86
 
86
- * If you're running Webrick, you may not be able to kill the server with Ctrl-C. This is a bug in recent versions of Webrick.
87
+ * If you're running Webrick, you may not be able to kill the server with Ctrl-C. This is apparently due to a bug in recent versions of Webrick.
87
88
  * Workaround: `gem install thin` -- if thin is installed, deck will use it instead of webrick
89
+ * auxiliary files (e.g. images) are interleaved in URL path space, so overlapping file names might not resolve to the right file
90
+ * todo: rewrite internal links to files and serve them relative to current dir, not slide dir
91
+ * H1s (which split slides) are converted to H2s for compatibility with deck.js's CSS themes
92
+ * unless they're the only item on the slide, in which case they remain H1s
93
+ * we use RedCarpet to process markdown, which doesn't work exactly the same as RDiscount... for example:
94
+ * indented code blocks under a bullet point may need to be indented more
95
+ * code blocks must be separated from the previous text by a newline
96
+ * slide scaling isn't perfect; sometimes either resizing or reloading will improve the layout
88
97
 
89
98
  Report bugs on <http://github.com/alexch/deck.rb/issues>
90
99
 
@@ -100,17 +109,6 @@ Report bugs on <http://github.com/alexch/deck.rb/issues>
100
109
  * [Showoff](https://github.com/schacon/showoff) by Scott Chacon
101
110
  * [Keydown](https://github.com/infews/keydown) by Davis Frank
102
111
 
103
- ## Bugs and Limitations
104
-
105
- * auxiliary files (e.g. images) are interleaved in URL path space, so overlapping file names might not resolve to the right file
106
- * todo: rewrite internal links to files and serve them relative to current dir, not slide dir
107
- * H1s (which split slides) are converted to H2s for compatibility with deck.js's CSS themes
108
- * unless they're the only item on the slide, in which case they remain H1s
109
- * we use RedCarpet to process markdown, which doesn't work exactly the same as RDiscount... for example:
110
- * indented code blocks under a bullet point may need to be indented more
111
- * code blocks must be separated from the previous text by a newline
112
- * slide scaling isn't perfect; sometimes either resizing or reloading will improve the layout
113
-
114
112
  ## TODO
115
113
 
116
114
  * fix title tag (base it off of presentation name or something)
@@ -153,6 +151,13 @@ Report bugs on <http://github.com/alexch/deck.rb/issues>
153
151
  * nested sections
154
152
  * disappear when clicked outside of, esc pressed, etc.
155
153
  * close box
154
+ * requests from Christopher Gandrud <http://christophergandrud.blogspot.com/2012/05/aspirational-useful-deckrb-with.html>
155
+ * There really aren’t title slides.
156
+ * The slideshow opens as a locally hosted webserver, and the command to build a stand alone HTML presentation doesn’t seem to work that well (hence no example included with this post).
157
+ * It only allows you to use the Swiss template.
158
+ * I couldn’t figure out how to easily get MathJax support to display equations.
159
+
160
+
156
161
 
157
162
  ## TODO (community)
158
163
 
data/lib/deck/slide.rb CHANGED
@@ -93,6 +93,10 @@ module Deck
93
93
  end
94
94
 
95
95
  def <<(s)
96
+ if s.strip =~ /^\s*<?!VIDEO +([^\s>]*)>?$/
97
+ youtube_id = $1
98
+ s = %Q(<iframe class="video youtube" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/#{youtube_id}" frameborder="0"></iframe>\n)
99
+ end
96
100
  @markdown_text << s
97
101
  @markdown_text << "\n"
98
102
  end
data/lib/deck/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Deck
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
data/spec/slide_spec.rb CHANGED
@@ -299,6 +299,28 @@ foo
299
299
  end
300
300
  end
301
301
 
302
+ describe "!VIDEO" do
303
+ it "embeds a YouTube video" do
304
+ html = slide_from(<<-MARKDOWN).to_pretty
305
+ # foo
306
+ <!VIDEO xyzzy>
307
+ * bar
308
+ MARKDOWN
309
+ expected_html = <<-HTML
310
+ <section class="slide" id="foo">
311
+ <h2>foo</h2>
312
+
313
+ <iframe class="video youtube" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/xyzzy" frameborder="0"></iframe>
314
+
315
+ <ul>
316
+ <li>bar</li>
317
+ </ul>
318
+ </section>
319
+ HTML
320
+ assert { html == expected_html }
321
+ end
322
+ end
323
+
302
324
  describe "==" do
303
325
  it "a slide is equal to itself" do
304
326
  s = slide_from("# hello")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deckrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erector
@@ -249,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  segments:
251
251
  - 0
252
- hash: 1497059126395334120
252
+ hash: 2930937714507842566
253
253
  required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  none: false
255
255
  requirements:
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  segments:
260
260
  - 0
261
- hash: 1497059126395334120
261
+ hash: 2930937714507842566
262
262
  requirements: []
263
263
  rubyforge_project:
264
264
  rubygems_version: 1.8.21