slide-em-up 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require "albino"
1
2
  require "nolate"
2
3
  require "redcarpet"
3
4
  require "yajl"
@@ -75,12 +76,35 @@ module SlideEmUp
75
76
  parts = raw.split(/!SLIDE */)
76
77
  parts.delete('')
77
78
  slides = parts.map.with_index do |slide,j|
79
+ @codemap = {}
78
80
  classes, md = slide.split("\n", 2)
79
- html = Redcarpet.new(md).to_html
81
+ html = Redcarpet.new(extract_code md).to_html
82
+ html = process_code(html)
80
83
  Slide.new(j, classes, md, html)
81
84
  end
82
85
  Section.new(i, title, slides)
83
86
  end
84
87
  end
88
+
89
+ # Code taken from gollum (http://github.com/github/gollum)
90
+ def extract_code(md)
91
+ md.gsub(/^``` ?(.+?)\r?\n(.+?)\r?\n```\r?$/m) do
92
+ id = Digest::SHA1.hexdigest($2)
93
+ @codemap[id] = { :lang => $1, :code => $2 }
94
+ id
95
+ end
96
+ end
97
+
98
+ def process_code(data)
99
+ @codemap.each do |id, spec|
100
+ lang, code = spec[:lang], spec[:code]
101
+ if code.lines.all? { |line| line =~ /\A\r?\n\Z/ || line =~ /^( |\t)/ }
102
+ code.gsub!(/^( |\t)/m, '')
103
+ end
104
+ output = Albino.new(code, lang).colorize(:P => "nowrap")
105
+ data.gsub!(id, "<pre><code class=\"#{lang}\">#{output}</code></pre>")
106
+ end
107
+ data
108
+ end
85
109
  end
86
110
  end
@@ -1,3 +1,3 @@
1
1
  module SlideEmUp
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,324 @@
1
+ /* line 1, ../../../app/stylesheets/pygments/colorful.scss */
2
+ .hll {
3
+ background-color: #ffffcc;
4
+ }
5
+
6
+ /* line 3, ../../../app/stylesheets/pygments/colorful.scss */
7
+ .c {
8
+ color: #808080;
9
+ }
10
+
11
+ /* line 5, ../../../app/stylesheets/pygments/colorful.scss */
12
+ .err {
13
+ color: #F00000;
14
+ background-color: #F0A0A0;
15
+ }
16
+
17
+ /* line 8, ../../../app/stylesheets/pygments/colorful.scss */
18
+ .k {
19
+ color: #008000;
20
+ font-weight: bold;
21
+ }
22
+
23
+ /* line 11, ../../../app/stylesheets/pygments/colorful.scss */
24
+ .o {
25
+ color: #303030;
26
+ }
27
+
28
+ /* line 13, ../../../app/stylesheets/pygments/colorful.scss */
29
+ .cm {
30
+ color: #808080;
31
+ }
32
+
33
+ /* line 15, ../../../app/stylesheets/pygments/colorful.scss */
34
+ .cp {
35
+ color: #507090;
36
+ }
37
+
38
+ /* line 17, ../../../app/stylesheets/pygments/colorful.scss */
39
+ .c1 {
40
+ color: #808080;
41
+ }
42
+
43
+ /* line 19, ../../../app/stylesheets/pygments/colorful.scss */
44
+ .cs {
45
+ color: #cc0000;
46
+ font-weight: bold;
47
+ }
48
+
49
+ /* line 22, ../../../app/stylesheets/pygments/colorful.scss */
50
+ .gd {
51
+ color: #A00000;
52
+ }
53
+
54
+ /* line 24, ../../../app/stylesheets/pygments/colorful.scss */
55
+ .ge {
56
+ font-style: italic;
57
+ }
58
+
59
+ /* line 26, ../../../app/stylesheets/pygments/colorful.scss */
60
+ .gr {
61
+ color: #FF0000;
62
+ }
63
+
64
+ /* line 28, ../../../app/stylesheets/pygments/colorful.scss */
65
+ .gh {
66
+ color: #000080;
67
+ font-weight: bold;
68
+ }
69
+
70
+ /* line 31, ../../../app/stylesheets/pygments/colorful.scss */
71
+ .gi {
72
+ color: #00A000;
73
+ }
74
+
75
+ /* line 33, ../../../app/stylesheets/pygments/colorful.scss */
76
+ .go {
77
+ color: #808080;
78
+ }
79
+
80
+ /* line 35, ../../../app/stylesheets/pygments/colorful.scss */
81
+ .gp {
82
+ color: #c65d09;
83
+ font-weight: bold;
84
+ }
85
+
86
+ /* line 38, ../../../app/stylesheets/pygments/colorful.scss */
87
+ .gs {
88
+ font-weight: bold;
89
+ }
90
+
91
+ /* line 40, ../../../app/stylesheets/pygments/colorful.scss */
92
+ .gu {
93
+ color: #800080;
94
+ font-weight: bold;
95
+ }
96
+
97
+ /* line 43, ../../../app/stylesheets/pygments/colorful.scss */
98
+ .gt {
99
+ color: #0040D0;
100
+ }
101
+
102
+ /* line 45, ../../../app/stylesheets/pygments/colorful.scss */
103
+ .kc, .kd, .kn {
104
+ color: #008000;
105
+ font-weight: bold;
106
+ }
107
+
108
+ /* line 48, ../../../app/stylesheets/pygments/colorful.scss */
109
+ .kp {
110
+ color: #003080;
111
+ font-weight: bold;
112
+ }
113
+
114
+ /* line 51, ../../../app/stylesheets/pygments/colorful.scss */
115
+ .kr {
116
+ color: #008000;
117
+ font-weight: bold;
118
+ }
119
+
120
+ /* line 54, ../../../app/stylesheets/pygments/colorful.scss */
121
+ .kt {
122
+ color: #303090;
123
+ font-weight: bold;
124
+ }
125
+
126
+ /* line 57, ../../../app/stylesheets/pygments/colorful.scss */
127
+ .m {
128
+ color: #6000E0;
129
+ font-weight: bold;
130
+ }
131
+
132
+ /* line 60, ../../../app/stylesheets/pygments/colorful.scss */
133
+ .s {
134
+ background-color: #fff0f0;
135
+ }
136
+
137
+ /* line 62, ../../../app/stylesheets/pygments/colorful.scss */
138
+ .na {
139
+ color: #0000C0;
140
+ }
141
+
142
+ /* line 64, ../../../app/stylesheets/pygments/colorful.scss */
143
+ .nb {
144
+ color: #007020;
145
+ }
146
+
147
+ /* line 66, ../../../app/stylesheets/pygments/colorful.scss */
148
+ .nc {
149
+ color: #B00060;
150
+ font-weight: bold;
151
+ }
152
+
153
+ /* line 69, ../../../app/stylesheets/pygments/colorful.scss */
154
+ .no {
155
+ color: #003060;
156
+ font-weight: bold;
157
+ }
158
+
159
+ /* line 72, ../../../app/stylesheets/pygments/colorful.scss */
160
+ .nd {
161
+ color: #505050;
162
+ font-weight: bold;
163
+ }
164
+
165
+ /* line 75, ../../../app/stylesheets/pygments/colorful.scss */
166
+ .ni {
167
+ color: #800000;
168
+ font-weight: bold;
169
+ }
170
+
171
+ /* line 78, ../../../app/stylesheets/pygments/colorful.scss */
172
+ .ne {
173
+ color: #F00000;
174
+ font-weight: bold;
175
+ }
176
+
177
+ /* line 81, ../../../app/stylesheets/pygments/colorful.scss */
178
+ .nf {
179
+ color: #0060B0;
180
+ font-weight: bold;
181
+ }
182
+
183
+ /* line 84, ../../../app/stylesheets/pygments/colorful.scss */
184
+ .nl {
185
+ color: #907000;
186
+ font-weight: bold;
187
+ }
188
+
189
+ /* line 87, ../../../app/stylesheets/pygments/colorful.scss */
190
+ .nn {
191
+ color: #0e84b5;
192
+ font-weight: bold;
193
+ }
194
+
195
+ /* line 90, ../../../app/stylesheets/pygments/colorful.scss */
196
+ .nt {
197
+ color: #007000;
198
+ }
199
+
200
+ /* line 92, ../../../app/stylesheets/pygments/colorful.scss */
201
+ .nv {
202
+ color: #906030;
203
+ }
204
+
205
+ /* line 94, ../../../app/stylesheets/pygments/colorful.scss */
206
+ .ow {
207
+ color: #000000;
208
+ font-weight: bold;
209
+ }
210
+
211
+ /* line 97, ../../../app/stylesheets/pygments/colorful.scss */
212
+ .w {
213
+ color: #bbbbbb;
214
+ }
215
+
216
+ /* line 99, ../../../app/stylesheets/pygments/colorful.scss */
217
+ .mf {
218
+ color: #6000E0;
219
+ font-weight: bold;
220
+ }
221
+
222
+ /* line 102, ../../../app/stylesheets/pygments/colorful.scss */
223
+ .mh {
224
+ color: #005080;
225
+ font-weight: bold;
226
+ }
227
+
228
+ /* line 105, ../../../app/stylesheets/pygments/colorful.scss */
229
+ .mi {
230
+ color: #0000D0;
231
+ font-weight: bold;
232
+ }
233
+
234
+ /* line 108, ../../../app/stylesheets/pygments/colorful.scss */
235
+ .mo {
236
+ color: #4000E0;
237
+ font-weight: bold;
238
+ }
239
+
240
+ /* line 111, ../../../app/stylesheets/pygments/colorful.scss */
241
+ .sb {
242
+ background-color: #fff0f0;
243
+ }
244
+
245
+ /* line 113, ../../../app/stylesheets/pygments/colorful.scss */
246
+ .sc {
247
+ color: #0040D0;
248
+ }
249
+
250
+ /* line 115, ../../../app/stylesheets/pygments/colorful.scss */
251
+ .sd {
252
+ color: #D04020;
253
+ }
254
+
255
+ /* line 117, ../../../app/stylesheets/pygments/colorful.scss */
256
+ .s2 {
257
+ background-color: #fff0f0;
258
+ }
259
+
260
+ /* line 119, ../../../app/stylesheets/pygments/colorful.scss */
261
+ .se {
262
+ color: #606060;
263
+ font-weight: bold;
264
+ background-color: #fff0f0;
265
+ }
266
+
267
+ /* line 123, ../../../app/stylesheets/pygments/colorful.scss */
268
+ .sh {
269
+ background-color: #fff0f0;
270
+ }
271
+
272
+ /* line 125, ../../../app/stylesheets/pygments/colorful.scss */
273
+ .si {
274
+ background-color: #e0e0e0;
275
+ }
276
+
277
+ /* line 127, ../../../app/stylesheets/pygments/colorful.scss */
278
+ .sx {
279
+ color: #D02000;
280
+ background-color: #fff0f0;
281
+ }
282
+
283
+ /* line 130, ../../../app/stylesheets/pygments/colorful.scss */
284
+ .sr {
285
+ color: #000000;
286
+ background-color: #fff0ff;
287
+ }
288
+
289
+ /* line 133, ../../../app/stylesheets/pygments/colorful.scss */
290
+ .s1 {
291
+ background-color: #fff0f0;
292
+ }
293
+
294
+ /* line 135, ../../../app/stylesheets/pygments/colorful.scss */
295
+ .ss {
296
+ color: #A06000;
297
+ }
298
+
299
+ /* line 137, ../../../app/stylesheets/pygments/colorful.scss */
300
+ .bp {
301
+ color: #007020;
302
+ }
303
+
304
+ /* line 139, ../../../app/stylesheets/pygments/colorful.scss */
305
+ .vc {
306
+ color: #306090;
307
+ }
308
+
309
+ /* line 141, ../../../app/stylesheets/pygments/colorful.scss */
310
+ .vg {
311
+ color: #d07000;
312
+ font-weight: bold;
313
+ }
314
+
315
+ /* line 144, ../../../app/stylesheets/pygments/colorful.scss */
316
+ .vi {
317
+ color: #3030B0;
318
+ }
319
+
320
+ /* line 146, ../../../app/stylesheets/pygments/colorful.scss */
321
+ .il {
322
+ color: #0000D0;
323
+ font-weight: bold;
324
+ }
@@ -207,3 +207,8 @@ img {
207
207
  -moz-box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
208
208
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
209
209
  }
210
+
211
+ pre {
212
+ font-family: monospace;
213
+ text-align: left;
214
+ }
@@ -6,6 +6,7 @@
6
6
  <link href='http://fonts.googleapis.com/css?family=Crimson+Text:regular,600,bold' rel='stylesheet' type='text/css'>
7
7
  <link rel="stylesheet" href="/css/reset.css">
8
8
  <link rel="stylesheet" href="/css/main.css">
9
+ <link rel="stylesheet" href="/css/colorful.css">
9
10
  </head>
10
11
  <body>
11
12
  <div id="main">
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slide-em-up
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bruno Michel
@@ -79,9 +79,40 @@ dependencies:
79
79
  type: :runtime
80
80
  version_requirements: *id004
81
81
  - !ruby/object:Gem::Dependency
82
- name: minitest
82
+ name: albino
83
83
  prerelease: false
84
84
  requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ hash: 9
90
+ segments:
91
+ - 1
92
+ - 3
93
+ version: "1.3"
94
+ type: :runtime
95
+ version_requirements: *id005
96
+ - !ruby/object:Gem::Dependency
97
+ name: posix-spawn
98
+ prerelease: false
99
+ requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - "="
103
+ - !ruby/object:Gem::Version
104
+ hash: 21
105
+ segments:
106
+ - 0
107
+ - 3
108
+ - 3
109
+ version: 0.3.3
110
+ type: :runtime
111
+ version_requirements: *id006
112
+ - !ruby/object:Gem::Dependency
113
+ name: minitest
114
+ prerelease: false
115
+ requirement: &id007 !ruby/object:Gem::Requirement
85
116
  none: false
86
117
  requirements:
87
118
  - - ~>
@@ -92,7 +123,7 @@ dependencies:
92
123
  - 0
93
124
  version: "2.0"
94
125
  type: :development
95
- version_requirements: *id005
126
+ version_requirements: *id007
96
127
  description: Slide'em up is a presentation tool that displays markdown-formatted slides
97
128
  email: bruno.michel@af83.com
98
129
  executables:
@@ -113,6 +144,7 @@ files:
113
144
  - lib/slide-em-up/version.rb
114
145
  - themes/3d_slideshow/fonts/league_gothic-webfont.ttf
115
146
  - themes/3d_slideshow/js/slideshow.js
147
+ - themes/3d_slideshow/css/colorful.css
116
148
  - themes/3d_slideshow/css/main.css
117
149
  - themes/3d_slideshow/css/reset.css
118
150
  - themes/3d_slideshow/README