slippery 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWZlNzVlMWYyMDZiNWQwOWQ0NDE5ZGIwYjg3YTE3N2JmOWUzYjYxOQ==
4
+ NWFiYjgwMGViMWZkOGRjOGY1ODRhZTkzZjc2NWU3OWM3NDVmNGM2ZQ==
5
5
  data.tar.gz: !binary |-
6
- NWM2ZGVhZmJiZGYxYmNmMzBlNmNmMWNjMDY3MGM1OTYzMWFmMmVmYQ==
6
+ OWFjYjk2MzlkNTExM2NlMWI5ZTE1ZGY4MDc5NTgzMGZiMzFiNWQxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWFjMjQ2OTk5YTg1ZDIyYjcxODliZDgwMmQ2ZTMzYTIyZGMyZjBhMjIxNzVl
10
- YWJmNDg4OTdmNDcwZTA5ZDdlYjVjNjYxNzYwZDUyN2MxYjY4ODQ3NDBlNmY1
11
- ZDE5M2RkYThkZDUyMTAxNGJhNDU2NDdmNzQ3ZTAxNzYyYzliZWE=
9
+ ZTc0NGNhMTM5MWE4ZDA1ZDI3MWQ3YjU4ODMwMTJkMjgwYjYyNzRjMTc4OTNh
10
+ NDFhZDI1YzA5YmI5OTJmNDk2MmI2ZWExNzg5MGM4ZTg4NDAyM2NjZWQxYjNk
11
+ MDlkMjc0ZmRjMWJhYmVhOGZjZDI2ZWM2YWQ2NTQzNTc3YTBhYmM=
12
12
  data.tar.gz: !binary |-
13
- MmNkMGE3N2MwYjFhODIyYWY3NmUyZTRjMDg5ODMxNDg4NzM1NTdhNWVmMjQ3
14
- NWVhZjEwNDFlOWYxZDI1MWI2NjJmYmFiNWU4ZTg2NmQwMWM1ZmZjY2I2YzZm
15
- ZWM3M2MxMWY1OTczNzQ3MTczZWQ1M2ExYjkxNDM3NmQyOTM2Zjg=
13
+ YmY2NTNlNjlhOTRlMjA4YmEyMmY1MTNkZTIwZmRhNTYwNjNhMzc3YmMwNzcx
14
+ ZmI2ZmJhMzNmOTU1NTYwN2IzMjAyMWQxY2EyMmM0YmQ0OWM0NjBiYzU1MWFl
15
+ YTNjNWM2YzA5MWIwNjM3YTQwZDdlNGVmZTgxNmI2ZjBjZDhkYmM=
@@ -0,0 +1,71 @@
1
+ # Logfile created on 2014-02-23 15:27:32 +0100 by logger.rb/31641
2
+ I, [2014-02-23T15:27:32.144969 #18519] INFO -- : 0: rake (10.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/rake-10.1.0.gemspec
3
+ I, [2014-02-23T15:27:32.145555 #18519] INFO -- : 0: abstract_type (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/abstract_type-0.0.6.gemspec
4
+ I, [2014-02-23T15:27:32.146017 #18519] INFO -- : 0: ice_nine (0.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/ice_nine-0.9.0.gemspec
5
+ I, [2014-02-23T15:27:33.847175 #18519] INFO -- : 0: adamantium (0.0.11) from /home/arne/.gem/ruby/1.9.3/specifications/adamantium-0.0.11.gemspec
6
+ I, [2014-02-23T15:27:33.847675 #18519] INFO -- : 0: backports (3.3.3) from /home/arne/.gem/ruby/1.9.3/specifications/backports-3.3.3.gemspec
7
+ I, [2014-02-23T15:27:36.243686 #18519] INFO -- : 0: equalizer (0.0.5) from /home/arne/.gem/ruby/1.9.3/specifications/equalizer-0.0.5.gemspec
8
+ I, [2014-02-23T15:27:37.834424 #18519] INFO -- : 0: anima (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/anima-0.0.6.gemspec
9
+ I, [2014-02-23T15:27:37.834899 #18519] INFO -- : 0: ast (1.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/ast-1.1.0.gemspec
10
+ I, [2014-02-23T15:27:37.835247 #18519] INFO -- : 0: bundler (1.5.1) from /home/arne/.gem/ruby/1.9.3/specifications/bundler-1.5.1.gemspec
11
+ I, [2014-02-23T15:27:37.835602 #18519] INFO -- : 0: coderay (1.0.9) from /home/arne/.gem/ruby/1.9.3/specifications/coderay-1.0.9.gemspec
12
+ I, [2014-02-23T15:27:37.835950 #18519] INFO -- : 0: colorize (0.5.8) from /home/arne/.gem/ruby/1.9.3/specifications/colorize-0.5.8.gemspec
13
+ I, [2014-02-23T15:27:39.347016 #18519] INFO -- : 0: concord (0.1.2) from /home/arne/.gem/ruby/1.9.3/specifications/concord-0.1.2.gemspec
14
+ I, [2014-02-23T15:27:40.752853 #18519] INFO -- : 0: multi_json (1.7.7) from /home/arne/.gem/ruby/1.9.3/specifications/multi_json-1.7.7.gemspec
15
+ I, [2014-02-23T15:27:42.348292 #18519] INFO -- : 0: mime-types (1.23) from /home/arne/.gem/ruby/1.9.3/specifications/mime-types-1.23.gemspec
16
+ I, [2014-02-23T15:27:42.348833 #18519] INFO -- : 0: rest-client (1.6.7) from /home/arne/.gem/ruby/1.9.3/specifications/rest-client-1.6.7.gemspec
17
+ I, [2014-02-23T15:27:42.349221 #18519] INFO -- : 0: simplecov-html (0.7.1) from /home/arne/.gem/ruby/1.9.3/specifications/simplecov-html-0.7.1.gemspec
18
+ I, [2014-02-23T15:27:42.349611 #18519] INFO -- : 0: simplecov (0.7.1) from /home/arne/.gem/ruby/1.9.3/specifications/simplecov-0.7.1.gemspec
19
+ I, [2014-02-23T15:27:42.349983 #18519] INFO -- : 0: thor (0.18.1) from /home/arne/.gem/ruby/1.9.3/specifications/thor-0.18.1.gemspec
20
+ I, [2014-02-23T15:27:42.350354 #18519] INFO -- : 0: coveralls (0.6.7) from /home/arne/.gem/ruby/1.9.3/specifications/coveralls-0.6.7.gemspec
21
+ I, [2014-02-23T15:27:42.350723 #18519] INFO -- : 0: descendants_tracker (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/descendants_tracker-0.0.1.gemspec
22
+ I, [2014-02-23T15:27:42.376637 #18519] INFO -- : 0: devtools (0.0.2) from /home/arne/.gem/ruby/1.9.3/bundler/gems/devtools-bca222ee252d/devtools.gemspec
23
+ I, [2014-02-23T15:27:42.377248 #18519] INFO -- : 0: diff-lcs (1.2.4) from /home/arne/.gem/ruby/1.9.3/specifications/diff-lcs-1.2.4.gemspec
24
+ I, [2014-02-23T15:27:42.377663 #18519] INFO -- : 0: ffi (1.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/ffi-1.9.0.gemspec
25
+ I, [2014-02-23T15:27:42.378065 #18519] INFO -- : 0: ffi-hunspell (0.3.0) from /home/arne/.gem/ruby/1.9.3/specifications/ffi-hunspell-0.3.0.gemspec
26
+ I, [2014-02-23T15:27:43.926273 #18519] INFO -- : 0: sexp_processor (4.2.1) from /home/arne/.gem/ruby/1.9.3/specifications/sexp_processor-4.2.1.gemspec
27
+ I, [2014-02-23T15:27:43.926825 #18519] INFO -- : 0: ruby_parser (3.1.3) from /home/arne/.gem/ruby/1.9.3/specifications/ruby_parser-3.1.3.gemspec
28
+ I, [2014-02-23T15:27:45.311529 #18519] INFO -- : 0: flay (2.3.1) from /home/arne/.gem/ruby/1.9.3/specifications/flay-2.3.1.gemspec
29
+ I, [2014-02-23T15:27:45.312027 #18519] INFO -- : 0: flog (4.1.1) from /home/arne/.gem/ruby/1.9.3/specifications/flog-4.1.1.gemspec
30
+ I, [2014-02-23T15:27:45.312377 #18519] INFO -- : 0: formatador (0.2.4) from /home/arne/.gem/ruby/1.9.3/specifications/formatador-0.2.4.gemspec
31
+ I, [2014-02-23T15:27:45.312743 #18519] INFO -- : 0: fzip (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/fzip-0.2.0.gemspec
32
+ I, [2014-02-23T15:27:45.313092 #18519] INFO -- : 0: rb-fsevent (0.9.3) from /home/arne/.gem/ruby/1.9.3/specifications/rb-fsevent-0.9.3.gemspec
33
+ I, [2014-02-23T15:27:45.313446 #18519] INFO -- : 0: rb-inotify (0.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/rb-inotify-0.9.0.gemspec
34
+ I, [2014-02-23T15:27:45.313786 #18519] INFO -- : 0: rb-kqueue (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/rb-kqueue-0.2.0.gemspec
35
+ I, [2014-02-23T15:27:46.784270 #18519] INFO -- : 0: listen (1.2.2) from /home/arne/.gem/ruby/1.9.3/specifications/listen-1.2.2.gemspec
36
+ I, [2014-02-23T15:27:46.784900 #18519] INFO -- : 0: lumberjack (1.0.4) from /home/arne/.gem/ruby/1.9.3/specifications/lumberjack-1.0.4.gemspec
37
+ I, [2014-02-23T15:27:48.173953 #18519] INFO -- : 0: method_source (0.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/method_source-0.8.1.gemspec
38
+ I, [2014-02-23T15:27:49.680455 #18519] INFO -- : 0: slop (3.4.5) from /home/arne/.gem/ruby/1.9.3/specifications/slop-3.4.5.gemspec
39
+ I, [2014-02-23T15:27:49.681067 #18519] INFO -- : 0: pry (0.9.12.2) from /home/arne/.gem/ruby/1.9.3/specifications/pry-0.9.12.2.gemspec
40
+ I, [2014-02-23T15:27:51.562761 #18519] INFO -- : 0: guard (1.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/guard-1.8.1.gemspec
41
+ I, [2014-02-23T15:27:51.563253 #18519] INFO -- : 0: guard-bundler (1.0.0) from /home/arne/.gem/ruby/1.9.3/specifications/guard-bundler-1.0.0.gemspec
42
+ I, [2014-02-23T15:27:51.563595 #18519] INFO -- : 0: inflecto (0.0.2) from /home/arne/.gem/ruby/1.9.3/specifications/inflecto-0.0.2.gemspec
43
+ I, [2014-02-23T15:27:55.012144 #18519] INFO -- : 0: parser (2.0.0.pre2) from /home/arne/.gem/ruby/1.9.3/specifications/parser-2.0.0.pre2.gemspec
44
+ I, [2014-02-23T15:27:57.130110 #18519] INFO -- : 0: rspec-core (2.14.3) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-core-2.14.3.gemspec
45
+ I, [2014-02-23T15:27:58.927580 #18519] INFO -- : 0: rspec-expectations (2.14.0) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-expectations-2.14.0.gemspec
46
+ I, [2014-02-23T15:28:00.911900 #18519] INFO -- : 0: rspec-mocks (2.14.1) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-mocks-2.14.1.gemspec
47
+ I, [2014-02-23T15:28:00.912443 #18519] INFO -- : 0: rspec (2.14.1) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-2.14.1.gemspec
48
+ I, [2014-02-23T15:28:03.003962 #18519] INFO -- : 0: unparser (0.0.8) from /home/arne/.gem/ruby/1.9.3/specifications/unparser-0.0.8.gemspec
49
+ I, [2014-02-23T15:28:05.401383 #18519] INFO -- : 0: mutant (0.3.0.beta18) from /home/arne/.gem/ruby/1.9.3/specifications/mutant-0.3.0.beta18.gemspec
50
+ I, [2014-02-23T15:28:05.401965 #18519] INFO -- : 0: guard-mutant (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/guard-mutant-0.0.1.gemspec
51
+ I, [2014-02-23T15:28:05.402415 #18519] INFO -- : 0: guard-rspec (3.0.2) from /home/arne/.gem/ruby/1.9.3/specifications/guard-rspec-3.0.2.gemspec
52
+ I, [2014-02-23T15:28:06.770115 #18519] INFO -- : 0: powerpack (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/powerpack-0.0.1.gemspec
53
+ I, [2014-02-23T15:28:06.770720 #18519] INFO -- : 0: rainbow (1.1.4) from /home/arne/.gem/ruby/1.9.3/specifications/rainbow-1.1.4.gemspec
54
+ I, [2014-02-23T15:28:06.962855 #18519] INFO -- : 0: rubocop (0.10.0) from /home/arne/.gem/ruby/1.9.3/bundler/gems/rubocop-e9fa7563d4ea/rubocop.gemspec
55
+ I, [2014-02-23T15:28:09.199035 #18519] INFO -- : 0: guard-rubocop (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/guard-rubocop-0.2.0.gemspec
56
+ I, [2014-02-23T15:28:09.199575 #18519] INFO -- : 0: mini_portile (0.5.2) from /home/arne/.gem/ruby/1.9.3/specifications/mini_portile-0.5.2.gemspec
57
+ I, [2014-02-23T15:28:09.199953 #18519] INFO -- : 0: nokogiri (1.6.1) from /home/arne/.gem/ruby/1.9.3/specifications/nokogiri-1.6.1.gemspec
58
+ I, [2014-02-23T15:28:09.200312 #18519] INFO -- : 0: sass (3.2.14) from /home/arne/.gem/ruby/1.9.3/specifications/sass-3.2.14.gemspec
59
+ I, [2014-02-23T15:28:09.289237 #18519] INFO -- : 0: hexp (0.3.1) from /home/arne/github/hexp/hexp.gemspec
60
+ I, [2014-02-23T15:28:09.289793 #18519] INFO -- : 0: kramdown (1.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/kramdown-1.1.0.gemspec
61
+ I, [2014-02-23T15:28:09.290207 #18519] INFO -- : 0: libnotify (0.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/libnotify-0.8.1.gemspec
62
+ I, [2014-02-23T15:28:09.290610 #18519] INFO -- : 0: rb-fchange (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/rb-fchange-0.0.6.gemspec
63
+ I, [2014-02-23T15:28:09.291033 #18519] INFO -- : 0: rb-notifu (0.0.4) from /home/arne/.gem/ruby/1.9.3/specifications/rb-notifu-0.0.4.gemspec
64
+ I, [2014-02-23T15:28:09.291431 #18519] INFO -- : 0: rbench (0.2.3) from /home/arne/.gem/ruby/1.9.3/specifications/rbench-0.2.3.gemspec
65
+ I, [2014-02-23T15:28:09.291823 #18519] INFO -- : 0: ruby2ruby (2.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/ruby2ruby-2.0.6.gemspec
66
+ I, [2014-02-23T15:28:09.427555 #18519] INFO -- : 0: reek (1.3.1) from /home/arne/.gem/ruby/1.9.3/bundler/gems/reek-ae4d09078ae2/reek.gemspec
67
+ I, [2014-02-23T15:28:09.552134 #18519] INFO -- : 0: slippery (0.0.3) from /home/arne/github/slippery/slippery.gemspec
68
+ I, [2014-02-23T15:28:09.552653 #18519] INFO -- : 0: terminal-notifier-guard (1.5.3) from /home/arne/.gem/ruby/1.9.3/specifications/terminal-notifier-guard-1.5.3.gemspec
69
+ I, [2014-02-23T15:28:12.704415 #18519] INFO -- : 0: yard (0.8.6.2) from /home/arne/.gem/ruby/1.9.3/specifications/yard-0.8.6.2.gemspec
70
+ I, [2014-02-23T15:28:12.705047 #18519] INFO -- : 0: yard-spellcheck (0.1.5) from /home/arne/.gem/ruby/1.9.3/specifications/yard-spellcheck-0.1.5.gemspec
71
+ I, [2014-02-23T15:28:14.853347 #18519] INFO -- : 0: yardstick (0.9.6) from /home/arne/.gem/ruby/1.9.3/specifications/yardstick-0.9.6.gemspec
data/Gemfile.lock CHANGED
@@ -3,7 +3,7 @@ GIT
3
3
  revision: bca222ee252d4d4bd86f55967704965711e90096
4
4
  specs:
5
5
  devtools (0.0.2)
6
- ice_nine (~> 0.8.0)
6
+ ice_nine (~> 0.9.0)
7
7
 
8
8
  GIT
9
9
  remote: https://github.com/bbatsov/rubocop.git
@@ -27,16 +27,18 @@ GIT
27
27
  PATH
28
28
  remote: .
29
29
  specs:
30
- slippery (0.0.1)
30
+ slippery (0.0.3)
31
31
  hexp (~> 0.0)
32
32
  kramdown (~> 1.1)
33
+ rb-inotify
33
34
 
34
35
  PATH
35
36
  remote: /home/arne/github/hexp
36
37
  specs:
37
- hexp (0.2.0)
38
+ hexp (0.3.1)
38
39
  equalizer (~> 0.0)
39
- ice_nine (~> 0.8)
40
+ fzip (~> 0.1)
41
+ ice_nine (~> 0.9)
40
42
  nokogiri (~> 1.6)
41
43
  sass (~> 3.2)
42
44
 
@@ -45,7 +47,7 @@ GEM
45
47
  specs:
46
48
  abstract_type (0.0.6)
47
49
  adamantium (0.0.11)
48
- ice_nine (~> 0.8.0)
50
+ ice_nine (~> 0.9.0)
49
51
  anima (0.0.6)
50
52
  abstract_type (~> 0.0.4)
51
53
  adamantium (~> 0.0.6)
@@ -79,6 +81,7 @@ GEM
79
81
  ruby_parser (~> 3.1, > 3.1.0)
80
82
  sexp_processor (~> 4.0)
81
83
  formatador (0.2.4)
84
+ fzip (0.2.0)
82
85
  guard (1.8.1)
83
86
  formatador (>= 0.2.4)
84
87
  listen (>= 1.0.0)
@@ -98,7 +101,7 @@ GEM
98
101
  guard-rubocop (0.2.0)
99
102
  guard (~> 1.8)
100
103
  rubocop (~> 0.9)
101
- ice_nine (0.8.0)
104
+ ice_nine (0.9.0)
102
105
  inflecto (0.0.2)
103
106
  kramdown (1.1.0)
104
107
  libnotify (0.8.1)
@@ -110,7 +113,7 @@ GEM
110
113
  lumberjack (1.0.4)
111
114
  method_source (0.8.1)
112
115
  mime-types (1.23)
113
- mini_portile (0.5.1)
116
+ mini_portile (0.5.2)
114
117
  multi_json (1.7.7)
115
118
  mutant (0.3.0.beta18)
116
119
  adamantium (~> 0.0.10)
@@ -118,12 +121,12 @@ GEM
118
121
  concord (~> 0.1.1)
119
122
  descendants_tracker (~> 0.0.1)
120
123
  equalizer (~> 0.0.5)
121
- ice_nine (~> 0.8.0)
124
+ ice_nine (~> 0.9.0)
122
125
  inflecto (~> 0.0.2)
123
126
  parser (~> 2.0.0.pre2)
124
127
  rspec (~> 2.14.1)
125
128
  unparser (~> 0.0.8)
126
- nokogiri (1.6.0)
129
+ nokogiri (1.6.1)
127
130
  mini_portile (~> 0.5.0)
128
131
  parser (2.0.0.pre2)
129
132
  ast (~> 1.1)
@@ -160,7 +163,8 @@ GEM
160
163
  sexp_processor (~> 4.0)
161
164
  ruby_parser (3.1.3)
162
165
  sexp_processor (~> 4.1)
163
- sass (3.2.9)
166
+ rubygems-tasks (0.2.4)
167
+ sass (3.2.14)
164
168
  sexp_processor (4.2.1)
165
169
  simplecov (0.7.1)
166
170
  multi_json (~> 1.0)
@@ -197,7 +201,6 @@ DEPENDENCIES
197
201
  guard-rspec (~> 3.0.2)
198
202
  guard-rubocop (~> 0.2.0)
199
203
  hexp!
200
- slippery!
201
204
  jruby-openssl (~> 0.8.5)
202
205
  kramdown (~> 1.1.0)
203
206
  libnotify (~> 0.8.0)
@@ -213,7 +216,9 @@ DEPENDENCIES
213
216
  reek (~> 1.3.1)!
214
217
  rspec (~> 2.14.1)
215
218
  rubocop (~> 0.10.0)!
219
+ rubygems-tasks
216
220
  simplecov (~> 0.7.1)
221
+ slippery!
217
222
  terminal-notifier-guard (~> 1.5.3)
218
223
  yard (~> 0.8.6.2)
219
224
  yard-spellcheck (~> 0.1.5)
data/README.md CHANGED
@@ -12,23 +12,61 @@
12
12
 
13
13
  #Slippery
14
14
 
15
- The most flexible, customizable way to generate slides from Markdown.
15
+ Marries the flexible [Kramdown](https://kramdown.rubyforge.org) parser for Markdown with the flexibility of DOM manipulation with [Hexp](https://github.com/plexus/hexp) to generate HTML slides backed by either Reveal.js or Impress.js.
16
+
17
+ Because Slippery slides are the best slides.
16
18
 
17
19
  ## How to use
18
20
 
19
21
  Create a markdown file, say `presentation.md`, that will be the source of your presentation. use `---` to separate slides.
20
22
 
21
- In the same directory, create a Rakefile, here's a basic example :
23
+ In the same directory, create a Rakefile, the most basic form is :
22
24
 
23
25
  ```ruby
24
- task :build_presentation do
25
- doc = Slippery::Document.new(File.read('presentation.md'))
26
- presentation = Slippery::Presentation.new(doc, type: :reveal_js)
27
- File.write('presentation.html', presentation.to_html)
26
+ require 'slippery'
27
+
28
+ Slippery::RakeTasks.new
29
+ ```
30
+
31
+ Slippery will detect and markdown files in the current directory, and generate rake tasks for them.
32
+
33
+ ```
34
+ rake slippery:build # build all
35
+ rake slippery:build:presentation # build presentation
36
+ ```
37
+
38
+
39
+ You can use a block to configure Slippery:
40
+
41
+ ```ruby
42
+ require 'slippery'
43
+
44
+ Slippery::RakeTasks.new do |s|
45
+ s.options = {
46
+ type: :reveal_js,
47
+ theme: 'beige',
48
+ controls: false,
49
+ backgroundTransition: 'slide',
50
+ history: true,
51
+ plugins: [:notes]
52
+ }
53
+
54
+ s.processor 'head' do |head|
55
+ head <<= H[:title, 'Web Services, Past Present Future']
56
+ end
28
57
  end
29
58
  ```
30
59
 
31
- The presentation object responds to the [Hexp](http://github.com/plexus/hexp) DSL, so you can manipulate it before writing it out. In fact, Slippery contains several "processor objects" for common tasks.
60
+ After converting your presentation from Markdown, you can use Hexp to perform transformations on the result. This is what happens with the `processor`, you pass it a CSS selector, each matching element gets passed into the block, and replaced by whatever the block returns. See the [Hexp](http://github.com/plexus/hexp) DSL for details.
61
+
62
+ You can also add built-in or custom processors directly
63
+
64
+ ```ruby
65
+ Slippery::RakeTasks.new do |s|
66
+ s.processors << Slippery::Processors::GraphvizDot.new('.dot')
67
+ s.processors << Slippery::Processors::SelfContained
68
+ end
69
+ ```
32
70
 
33
71
  ## Processors
34
72
 
@@ -56,13 +94,9 @@ In your presentation :
56
94
  In the Rakefile
57
95
 
58
96
  ```ruby
59
- task :build_presentation do
60
- include Slippery::Processors
61
- doc = Slippery::Document.new(File.read('presentation.md'))
62
- presentation = Slippery::Presentation.new(doc, type: :reveal_js)
63
- .process(GraphvizDot)
64
-
65
- File.write('presentation.html', presentation.to_html)
97
+ Slippery::RakeTasks.new do |s|
98
+ s.processors << Slippery::Processors::GraphvizDot.new('.dot')
99
+ s.processors << Slippery::Processors::SelfContained
66
100
  end
67
101
  ```
68
102
 
data/Rakefile CHANGED
@@ -1,2 +1,5 @@
1
1
  require 'devtools'
2
2
  Devtools.init_rake_tasks
3
+
4
+ require 'rubygems/tasks'
5
+ Gem::Tasks.new
@@ -0,0 +1,23 @@
1
+ require 'fileutils'
2
+
3
+ # Manage the assets and their URI/path
4
+ module Slippery
5
+ module Assets
6
+ ASSETS_PATH = '../../../assets/'
7
+
8
+ # Copies the assets locally
9
+ def self.embed_locally
10
+ FileUtils.cp_r(File.expand_path(ASSETS_PATH, __FILE__), './')
11
+ end
12
+
13
+ # returns a composer returning a URI for a given relative file path
14
+ # considering if the asset is local or not
15
+ def self.path_composer(local)
16
+ if local
17
+ ->(path) { File.join('assets', path) }
18
+ else
19
+ ->(path) { "file://#{File.expand_path(File.join(ASSETS_PATH, path), __FILE__)}" }
20
+ end
21
+ end
22
+ end
23
+ end
@@ -15,6 +15,5 @@ module Slippery
15
15
  def to_hexp
16
16
  @hexp ||= Slippery::Converter.new.convert(kramdown_document.root).to_hexp
17
17
  end
18
-
19
18
  end
20
19
  end
@@ -3,30 +3,33 @@ module Slippery
3
3
  include Hexp
4
4
 
5
5
  DEFAULT_OPTIONS = {
6
- type: :reveal_js
6
+ type: :reveal_js,
7
+ local: true
7
8
  }.freeze
8
9
 
9
10
  def initialize(document, options = {})
10
11
  @document = document
11
12
  @options = DEFAULT_OPTIONS.merge(options).freeze
13
+
14
+ Assets::embed_locally if @options[:local]
12
15
  end
13
16
 
14
17
  def processors
15
18
  {
16
- :impress_js => [
17
- HrToSections.new(H[:div, class: 'step']),
18
- ImpressJs::AddImpressJs.new(js_options),
19
- ImpressJs::AutoOffsets.new,
19
+ impress_js: [
20
+ Processors::HrToSections.new(H[:div, class: 'step']),
21
+ Processors::ImpressJs::AddImpressJs.new(Assets::path_composer(@options[:local]), js_options),
22
+ Processors::ImpressJs::AutoOffsets.new,
20
23
  ],
21
- :reveal_js => [
22
- HrToSections.new(H[:section]),
23
- RevealJs::AddRevealJs.new(js_options),
24
+ reveal_js: [
25
+ Processors::HrToSections.new(H[:section]),
26
+ Processors::RevealJs::AddRevealJs.new(Assets::path_composer(@options[:local]), js_options),
24
27
  ]
25
28
  }[@options[:type]]
26
29
  end
27
30
 
28
31
  def js_options
29
- @options.reject {|key,_| [:type].include? key }
32
+ @options.reject { |key, _| [:type].include? key }
30
33
  end
31
34
 
32
35
  def to_hexp
@@ -4,16 +4,12 @@ module Slippery
4
4
  klz.extend ClassMethods
5
5
  end
6
6
 
7
- def include_local_javascript(element, relative_path)
8
- element.add javascript_include_tag(asset_uri(relative_path))
7
+ def include_local_javascript(element, path)
8
+ element.add javascript_include_tag(path)
9
9
  end
10
10
 
11
- def include_local_css(element, relative_path)
12
- element.add stylesheet_link_tag(asset_uri(relative_path))
13
- end
14
-
15
- def asset_uri(path)
16
- 'file://' + File.expand_path('../../../assets/'+ path, __FILE__)
11
+ def include_local_css(element, path)
12
+ element.add stylesheet_link_tag(path)
17
13
  end
18
14
 
19
15
  def javascript_include_tag(path)
@@ -25,14 +21,14 @@ module Slippery
25
21
  end
26
22
 
27
23
  def data_attributes(attrs)
28
- Hash[*attrs.flat_map {|k,v| ["data-#{k}", v]}]
24
+ Hash[*attrs.flat_map { |k, v| ["data-#{k}", v] }]
29
25
  end
30
26
 
31
27
  module ClassMethods
32
28
  def processor(name, selector = nil, &blk)
33
29
  if selector
34
30
  define_method name do
35
- ->(node) { node.replace(selector) {|node| instance_exec(node, &blk) } }
31
+ ->(node) { node.replace(selector) { |node| instance_exec(node, &blk) } }
36
32
  end
37
33
  else
38
34
  define_method name { ->(node) { blk.call(node) } }
@@ -11,8 +11,8 @@ module Slippery
11
11
  self.new.call(doc)
12
12
  end
13
13
 
14
- def initialize(wrapper = H[:section], selector = 'body')
15
- @selector, @wrapper = selector, wrapper
14
+ def initialize(wrapper = H[:section], selector = 'body', options = {})
15
+ @selector, @wrapper, @anchor = selector, wrapper, options.fetch(:anchor, true)
16
16
  end
17
17
 
18
18
  def call(doc)
@@ -21,9 +21,15 @@ module Slippery
21
21
 
22
22
  def hr_to_section(element)
23
23
  sections = [@wrapper]
24
+ page = 1
24
25
  element.children.each do |child|
25
26
  if child.tag == :hr
26
- sections << @wrapper.merge_attrs(child)
27
+ last_section = @wrapper.merge_attrs(child)
28
+ if @anchor
29
+ last_section = last_section.merge_attrs(name: "#{page}")
30
+ page += 1
31
+ end
32
+ sections << last_section
27
33
  else
28
34
  sections[-1] = sections.last << child
29
35
  end
@@ -10,20 +10,22 @@ module Slippery
10
10
 
11
11
  attr_reader :attributes
12
12
 
13
- DEFAULT_ATTRS = {'transition-duration' => 1000}.freeze
13
+ DEFAULT_ATTRS = {
14
+ 'transition-duration' => 1000
15
+ }.freeze
14
16
 
15
- def initialize(attributes = {})
17
+ def initialize(path_composer, attributes = {})
18
+ @path_composer = path_composer
16
19
  @attributes = DEFAULT_ATTRS.merge(attributes).freeze
17
20
  end
18
21
 
19
22
  def call(doc)
20
23
  doc.replace('body') do |body|
21
- include_local_javascript(body, 'impress.js/js/impress.js')
24
+ include_local_javascript(body, @path_composer.call('impress.js/js/impress.js'))
22
25
  .set_attributes({id: 'impress'}.merge(data_attributes(attributes)))
23
- .add H[:script, "impress().init();"]
26
+ .add H[:script, 'impress().init();']
24
27
  end
25
28
  end
26
-
27
29
  end
28
30
  end
29
31
  end
@@ -12,7 +12,8 @@ module Slippery
12
12
 
13
13
  DEFAULT_OPTIONS = {theme: 'default'}.freeze
14
14
 
15
- def initialize(options = {})
15
+ def initialize(path_composer, options = {})
16
+ @path_composer = path_composer
16
17
  @options = DEFAULT_OPTIONS.merge(options).freeze
17
18
  end
18
19
 
@@ -27,20 +28,20 @@ module Slippery
27
28
  end
28
29
 
29
30
  processor :add_reveal_js, 'body' do |body|
30
- body = include_local_javascript(body, 'reveal.js/lib/js/head.min.js')
31
- include_local_javascript(body, 'reveal.js/js/reveal.js')
31
+ body = include_local_javascript(body, @path_composer.call('reveal.js/lib/js/head.min.js'))
32
+ include_local_javascript(body, @path_composer.call('reveal.js/js/reveal.js'))
32
33
  end
33
34
 
34
35
  processor :add_reveal_css, 'head' do |head|
35
- include_local_css(head, 'reveal.js/css/reveal.min.css')
36
+ include_local_css(head, @path_composer.call('reveal.js/css/reveal.min.css'))
36
37
  end
37
38
 
38
39
  processor :add_theme, 'head' do |head|
39
- include_local_css(head, "reveal.js/css/theme/#{@options[:theme]}.css")
40
+ include_local_css(head, @path_composer.call("reveal.js/css/theme/#{@options[:theme]}.css"))
40
41
  end
41
42
 
42
43
  processor :add_settings, 'body' do |body|
43
- body.add(H[:script, "Reveal.initialize({ #{plugin_settings}, #{settings.map {|k,v| "#{k}:#{v.inspect}"}.join(',')} });"])
44
+ body.add(H[:script, "Reveal.initialize({ #{plugin_settings}, #{settings.map { |k, v| "#{k}:#{v.inspect}" }.join(',')} });"])
44
45
  end
45
46
 
46
47
  processor :reveal_wrap, 'body' do |body|
@@ -53,14 +54,14 @@ module Slippery
53
54
  end
54
55
 
55
56
  def settings
56
- @options.reject{|key,_| [:theme, :plugins].include? key }
57
+ @options.reject { |key, _| [:theme, :plugins].include? key }
57
58
  end
58
59
 
59
60
  def plugin_settings
60
- "dependencies: [" +
61
+ 'dependencies: [' +
61
62
  Array(@options.fetch(:plugins, [])).map do |name|
62
63
  plugin_config name
63
- end.join(',') + "]"
64
+ end.join(',') + ']'
64
65
  end
65
66
 
66
67
  def plugins(name)
@@ -0,0 +1,100 @@
1
+ require 'rake/tasklib'
2
+ require 'rb-inotify'
3
+
4
+ module Slippery
5
+ class RakeTasks < Rake::TaskLib
6
+ attr_reader :name
7
+ attr_accessor :presentations, :options, :processors
8
+
9
+ def initialize(name = :slippery, &blk)
10
+ @name = name
11
+ @presentations = Pathname.glob('*.md')
12
+ @options = {}
13
+ @processors = []
14
+
15
+ if block_given?
16
+ if blk.arity == 0
17
+ self.instance_eval(&blk)
18
+ else
19
+ yield self
20
+ end
21
+ end
22
+ define
23
+ end
24
+
25
+ def presentation_names
26
+ presentations.map {|path| [ path.basename(path.extname), path ] }
27
+ end
28
+
29
+ def markdown_to_hexp(infile)
30
+ doc = Slippery::Document.new(infile.read)
31
+ doc = Slippery::Presentation.new(doc, options)
32
+
33
+ doc.process(*processors)
34
+ end
35
+
36
+ def processor(selector, &blk)
37
+ processors << ->(node) do
38
+ node.replace(selector) do |node|
39
+ instance_exec(node, &blk)
40
+ end
41
+ end
42
+ end
43
+
44
+ def self_contained
45
+ processors << Slippery::Processors::SelfContained
46
+ end
47
+
48
+ def define
49
+ namespace @name do
50
+ desc "build all"
51
+ task :build => presentation_names.map(&:first).map {|name| "#{@name}:build:#{name}"}
52
+
53
+ namespace :build do
54
+ presentation_names.each do |name, path|
55
+ desc "build #{name}"
56
+ task name do
57
+ File.write("#{name}.html", markdown_to_hexp(path).to_html)
58
+ end
59
+ end
60
+ end
61
+
62
+ namespace :watch do
63
+ presentation_names.each do |name, path|
64
+ desc "watch #{name} for changes"
65
+ WatchTask.new(name, [path.to_s]) do
66
+ dest = Tempfile.new("#{name}.html")
67
+ File.open("#{name}.html") { |src| FileUtils.copy_stream(src, dest) }
68
+ dest.close
69
+ Rake::Task["#{@name}:build:#{name}"].execute
70
+ puts "="*60
71
+ print `diff -u #{dest.path} #{name}.html` if File.exist? "#{name}.html"
72
+ end
73
+ end
74
+ end
75
+
76
+ end
77
+
78
+ end
79
+ end
80
+
81
+
82
+ class WatchTask
83
+ def initialize(name, files, &block)
84
+ Rake::Task.define_task name do
85
+ Array(files).each do |pattern|
86
+ notifier.watch(pattern, :modify, &block)
87
+ end
88
+ at_exit do
89
+ block.call
90
+ notifier.run
91
+ end
92
+ end
93
+ end
94
+
95
+ def notifier
96
+ @notifier ||= INotify::Notifier.new
97
+ end
98
+ end
99
+
100
+ end
@@ -1,3 +1,3 @@
1
1
  module Slippery
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/slippery.rb CHANGED
@@ -27,6 +27,7 @@ end
27
27
  require 'slippery/version'
28
28
  require 'slippery/converter'
29
29
  require 'slippery/document'
30
+ require 'slippery/assets'
30
31
  require 'slippery/presentation'
31
32
 
32
33
  require 'slippery/processor_helpers'
@@ -40,3 +41,5 @@ require 'slippery/processors/impress_js/add_impress_js'
40
41
  require 'slippery/processors/impress_js/auto_offsets'
41
42
 
42
43
  require 'slippery/processors/reveal_js/add_reveal_js'
44
+
45
+ require 'slippery/rake_tasks'
data/slippery.gemspec CHANGED
@@ -19,7 +19,9 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_runtime_dependency 'hexp' , '~> 0.0'
21
21
  gem.add_runtime_dependency 'kramdown' , '~> 1.1'
22
+ gem.add_runtime_dependency 'rb-inotify'
22
23
 
23
24
  gem.add_development_dependency 'rake', '~> 10.1'
24
25
  gem.add_development_dependency 'rspec', '~> 2.14'
26
+ gem.add_development_dependency 'rubygems-tasks'
25
27
  end
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slippery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Brasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-27 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ prerelease: false
15
+ name: hexp
14
16
  requirement: !ruby/object:Gem::Requirement
15
17
  requirements:
16
18
  - - ~>
17
19
  - !ruby/object:Gem::Version
18
20
  version: '0.0'
19
- prerelease: false
21
+ type: :runtime
20
22
  version_requirements: !ruby/object:Gem::Requirement
21
23
  requirements:
22
24
  - - ~>
23
25
  - !ruby/object:Gem::Version
24
26
  version: '0.0'
25
- name: hexp
26
- type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
+ prerelease: false
29
+ name: kramdown
28
30
  requirement: !ruby/object:Gem::Requirement
29
31
  requirements:
30
32
  - - ~>
31
33
  - !ruby/object:Gem::Version
32
34
  version: '1.1'
33
- prerelease: false
35
+ type: :runtime
34
36
  version_requirements: !ruby/object:Gem::Requirement
35
37
  requirements:
36
38
  - - ~>
37
39
  - !ruby/object:Gem::Version
38
40
  version: '1.1'
39
- name: kramdown
41
+ - !ruby/object:Gem::Dependency
42
+ prerelease: false
43
+ name: rb-inotify
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
40
49
  type: :runtime
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
56
+ prerelease: false
57
+ name: rake
42
58
  requirement: !ruby/object:Gem::Requirement
43
59
  requirements:
44
60
  - - ~>
45
61
  - !ruby/object:Gem::Version
46
62
  version: '10.1'
47
- prerelease: false
63
+ type: :development
48
64
  version_requirements: !ruby/object:Gem::Requirement
49
65
  requirements:
50
66
  - - ~>
51
67
  - !ruby/object:Gem::Version
52
68
  version: '10.1'
53
- name: rake
54
- type: :development
55
69
  - !ruby/object:Gem::Dependency
70
+ prerelease: false
71
+ name: rspec
56
72
  requirement: !ruby/object:Gem::Requirement
57
73
  requirements:
58
74
  - - ~>
59
75
  - !ruby/object:Gem::Version
60
76
  version: '2.14'
61
- prerelease: false
77
+ type: :development
62
78
  version_requirements: !ruby/object:Gem::Requirement
63
79
  requirements:
64
80
  - - ~>
65
81
  - !ruby/object:Gem::Version
66
82
  version: '2.14'
67
- name: rspec
83
+ - !ruby/object:Gem::Dependency
84
+ prerelease: false
85
+ name: rubygems-tasks
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
68
91
  type: :development
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: Make presentations with Markdown
70
98
  email:
71
99
  - arne@arnebrasseur.net
@@ -75,6 +103,7 @@ extra_rdoc_files:
75
103
  - README.md
76
104
  - LICENSE
77
105
  files:
106
+ - .bundle/install.log
78
107
  - .travis.yml
79
108
  - Gemfile
80
109
  - Gemfile.devtools
@@ -147,6 +176,7 @@ files:
147
176
  - config/rubocop.yml
148
177
  - config/yardstick.yml
149
178
  - lib/slippery.rb
179
+ - lib/slippery/assets.rb
150
180
  - lib/slippery/converter.rb
151
181
  - lib/slippery/document.rb
152
182
  - lib/slippery/presentation.rb
@@ -158,6 +188,7 @@ files:
158
188
  - lib/slippery/processors/impress_js/auto_offsets.rb
159
189
  - lib/slippery/processors/reveal_js/add_reveal_js.rb
160
190
  - lib/slippery/processors/self_contained.rb
191
+ - lib/slippery/rake_tasks.rb
161
192
  - lib/slippery/version.rb
162
193
  - slippery.gemspec
163
194
  - spec/fixtures/blockquotes.md
@@ -190,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
221
  version: '0'
191
222
  requirements: []
192
223
  rubyforge_project:
193
- rubygems_version: 2.1.10
224
+ rubygems_version: 2.2.1
194
225
  signing_key:
195
226
  specification_version: 4
196
227
  summary: Make presentations with Markdown
@@ -205,4 +236,3 @@ test_files:
205
236
  - spec/slippery/converter_spec.rb
206
237
  - spec/slippery_spec.rb
207
238
  - spec/spec_helper.rb
208
- has_rdoc: