slideoff 0.3.2 → 0.3.3
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.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/slideoff/markdown.rb +12 -0
- data/lib/slideoff/presentation.rb +1 -1
- data/lib/slideoff/utils.rb +8 -0
- data/lib/slideoff.rb +1 -1
- data/themes/modern/js/script.coffee +17 -0
- data/themes/modern/js/script.js +25 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a283925d99d7189d3016753e28952ea15014410f
|
|
4
|
+
data.tar.gz: 3f75827bbf04cc0073fd4125080a68c98fdd6c49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c59a73be6e9301c96858704e6158224fd9fc42058bf00a66fb9fd13ba8636e775a8e6109d76abae76831395c3b33b3a6d11477ae47b4c4983dea1bf3cd2842db
|
|
7
|
+
data.tar.gz: 0a15722c6c4df02968202566b862a451c1ca66b4508ac8a9e8c1e3073ea11f1d13b8ec5e0f65f13e3169129905f49d5cae07a57052edb9a21ecff14dd10ac514
|
data/README.md
CHANGED
|
@@ -204,6 +204,18 @@ This paragraph will be displayed first.
|
|
|
204
204
|
|
|
205
205
|
Try it in your example presentation after initialization.
|
|
206
206
|
|
|
207
|
+
You can add many states to one slide via the following snippet:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
!SLIDE
|
|
211
|
+
...
|
|
212
|
+
!STEPS[n]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
After each keystroke on right a class `step-i` is added to the `.slide` element while `i` is a number betweet 0 and
|
|
216
|
+
`n-1`. So you can change your styling for these different states. For example you can translate an element via CSS.
|
|
217
|
+
After these `n` keystrokes the next slide will be displayed.
|
|
218
|
+
|
|
207
219
|
|
|
208
220
|
## Issues or Suggestions
|
|
209
221
|
|
data/lib/slideoff/markdown.rb
CHANGED
|
@@ -32,6 +32,7 @@ module Slideoff
|
|
|
32
32
|
parse_description(text)
|
|
33
33
|
parse_flickr_image(text)
|
|
34
34
|
parse_pause(text)
|
|
35
|
+
parse_interactive_steps(text)
|
|
35
36
|
text
|
|
36
37
|
end
|
|
37
38
|
|
|
@@ -110,6 +111,17 @@ module Slideoff
|
|
|
110
111
|
text.gsub!(/^!PAUSE\s*$/) { %{<p class="pause"></p>} }
|
|
111
112
|
end
|
|
112
113
|
|
|
114
|
+
def parse_interactive_steps(text)
|
|
115
|
+
text.gsub!(/!STEPS\[(.*)\]/) do
|
|
116
|
+
step_count = $1.to_i
|
|
117
|
+
html = ""
|
|
118
|
+
step_count && step_count.times do |step|
|
|
119
|
+
html << %{<div data-step="#{step}" class="step step-#{step} inactive" style="display: none;"></div>}
|
|
120
|
+
end
|
|
121
|
+
html
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
113
125
|
def block_code(code, lang)
|
|
114
126
|
colorized = Pygments.highlight(code, :lexer => lang || "text", :options => {:nowrap => true})
|
|
115
127
|
code_lines = colorized.split("\n")
|
|
@@ -43,7 +43,7 @@ module Slideoff
|
|
|
43
43
|
Dir[ "#{CONFIG.pwd}#{asset}"].first ||
|
|
44
44
|
Dir[ "#{theme.dir}#{asset}"].first ||
|
|
45
45
|
Dir[ "#{common.dir}#{asset}"].first ||
|
|
46
|
-
Dir["#{CONFIG.pwd}/**#{asset}"].first
|
|
46
|
+
(Dir["#{CONFIG.pwd}/**#{asset}"] - Dir["#{CONFIG.static_dir}/**#{asset}"]).first
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def convert_styles(dir)
|
data/lib/slideoff/utils.rb
CHANGED
|
@@ -396,6 +396,14 @@ PageDown / Down / right / l / j | Goto next slide
|
|
|
396
396
|
}
|
|
397
397
|
EOF
|
|
398
398
|
end
|
|
399
|
+
File.open('script.js', 'w') do |file|
|
|
400
|
+
file.write <<-EOF
|
|
401
|
+
/* Write your js */
|
|
402
|
+
$(document).ready(function (e) {
|
|
403
|
+
console.log("Yeah, your are using slideoff! Have fun and be creative!");
|
|
404
|
+
});
|
|
405
|
+
EOF
|
|
406
|
+
end
|
|
399
407
|
puts `git init`
|
|
400
408
|
end
|
|
401
409
|
end
|
data/lib/slideoff.rb
CHANGED
|
@@ -309,11 +309,27 @@ class Slide
|
|
|
309
309
|
element = @firstInactiveElement()
|
|
310
310
|
@html().find('.current').first().addClass('visited')
|
|
311
311
|
@removePresentElement()
|
|
312
|
+
|
|
312
313
|
element.removeClass('inactive')
|
|
313
314
|
if element.is("pre[data-lang=sh] code")
|
|
314
315
|
element.typewriter()
|
|
315
316
|
else
|
|
316
317
|
element.addClass('current')
|
|
318
|
+
@incrementStep()
|
|
319
|
+
|
|
320
|
+
resetStep: ->
|
|
321
|
+
currentHtml = Slide.current().html()
|
|
322
|
+
step = 0
|
|
323
|
+
while currentHtml.hasClass("step-#{step}")
|
|
324
|
+
currentHtml.removeClass("step-#{step}")
|
|
325
|
+
step = step + 1
|
|
326
|
+
|
|
327
|
+
incrementStep: ->
|
|
328
|
+
currentHtml = Slide.current().html()
|
|
329
|
+
step = 0
|
|
330
|
+
while currentHtml.hasClass("step-#{step}")
|
|
331
|
+
step = step + 1
|
|
332
|
+
currentHtml.addClass("step-#{step}")
|
|
317
333
|
|
|
318
334
|
# private
|
|
319
335
|
|
|
@@ -356,6 +372,7 @@ class UserInterface
|
|
|
356
372
|
else
|
|
357
373
|
slide.html().removeClass('incr')
|
|
358
374
|
slide.removePresentElement()
|
|
375
|
+
slide.resetStep()
|
|
359
376
|
slide.next().goto()
|
|
360
377
|
|
|
361
378
|
@prevStep: ->
|
data/themes/modern/js/script.js
CHANGED
|
@@ -440,10 +440,33 @@ Slide = (function() {
|
|
|
440
440
|
if (element.is("pre[data-lang=sh] code")) {
|
|
441
441
|
return element.typewriter();
|
|
442
442
|
} else {
|
|
443
|
-
|
|
443
|
+
element.addClass('current');
|
|
444
|
+
return this.incrementStep();
|
|
444
445
|
}
|
|
445
446
|
};
|
|
446
447
|
|
|
448
|
+
Slide.prototype.resetStep = function() {
|
|
449
|
+
var currentHtml, step, _results;
|
|
450
|
+
currentHtml = Slide.current().html();
|
|
451
|
+
step = 0;
|
|
452
|
+
_results = [];
|
|
453
|
+
while (currentHtml.hasClass("step-" + step)) {
|
|
454
|
+
currentHtml.removeClass("step-" + step);
|
|
455
|
+
_results.push(step = step + 1);
|
|
456
|
+
}
|
|
457
|
+
return _results;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
Slide.prototype.incrementStep = function() {
|
|
461
|
+
var currentHtml, step;
|
|
462
|
+
currentHtml = Slide.current().html();
|
|
463
|
+
step = 0;
|
|
464
|
+
while (currentHtml.hasClass("step-" + step)) {
|
|
465
|
+
step = step + 1;
|
|
466
|
+
}
|
|
467
|
+
return currentHtml.addClass("step-" + step);
|
|
468
|
+
};
|
|
469
|
+
|
|
447
470
|
Slide.prototype.slideList = function() {
|
|
448
471
|
return Slide.slideList();
|
|
449
472
|
};
|
|
@@ -506,6 +529,7 @@ UserInterface = (function() {
|
|
|
506
529
|
} else {
|
|
507
530
|
slide.html().removeClass('incr');
|
|
508
531
|
slide.removePresentElement();
|
|
532
|
+
slide.resetStep();
|
|
509
533
|
return slide.next().goto();
|
|
510
534
|
}
|
|
511
535
|
};
|