Skip to content
This repository
Browse code

add ability to skip individual slides using the word 'skip' in the li…

…st of keywords and styles
  • Loading branch information...
commit 81a5669bd209b2d0abd403a53b94def19f8a7b85 1 parent cd36eac
authored
4  README.rdoc
Source Rendered
@@ -166,6 +166,10 @@ definition, where tname is one of the following supported transitions:
166 166
 
167 167
 The transitions are provided by jQuery Cycle plugin. See http://www.malsup.com/jquery/cycle/browser.html to view the effects and http://www.malsup.com/jquery/cycle/adv2.html for how to add custom effects.
168 168
 
  169
+Here's a list of other available keywords:
  170
+
  171
+* skip - Skips slides marked with this keyword
  172
+
169 173
 You can manage the presentation with the following keys:
170 174
 
171 175
 * space, cursor right: next slide
5  lib/showoff.rb
@@ -143,6 +143,9 @@ def <<(s)
143 143
       def empty?
144 144
         @text.strip == ""
145 145
       end
  146
+      def skip?
  147
+        @classes.include? 'skip'
  148
+      end
146 149
     end
147 150
 
148 151
 
@@ -171,7 +174,7 @@ def process_markdown(name, content, static=false, pdf=false)
171 174
         end
172 175
       end
173 176
 
174  
-      slides.delete_if {|slide| slide.empty? }
  177
+      slides.delete_if {|slide| slide.empty? || slide.skip? }
175 178
 
176 179
       final = ''
177 180
       if slides.size > 1
6  test/basic_test.rb
@@ -24,6 +24,12 @@ def app
24 24
     assert_match '<h1>My Presentation</h1>', last_response.body
25 25
   end
26 26
 
  27
+  test "can skip slides" do
  28
+    get '/slides'
  29
+    assert last_response.ok?
  30
+    assert_no_match /Skipped slide/, last_response.body
  31
+  end
  32
+
27 33
   test "can get asset list" do
28 34
     get '/assets_needed'
29 35
     assert last_response.ok?
6  test/fixtures/simple/one/01_slide.md
Source Rendered
@@ -7,3 +7,9 @@
7 7
 * first point
8 8
 * second point
9 9
 * third point
  10
+
  11
+!SLIDE skip
  12
+
  13
+# Skipped slide
  14
+
  15
+This won't show up

0 notes on commit 81a5669

Please sign in to comment.
Something went wrong with that request. Please try again.