Skip to content
Browse files

Merge pull request #185 from rafmagana/skip_slides

Add ability to skip individual slides
  • Loading branch information...
2 parents 492ba21 + 81a5669 commit e68a92be9a51b5a6628a61f75494abf07eb87aab @matthewmccullough matthewmccullough committed Jan 20, 2013
Showing with 20 additions and 1 deletion.
  1. +4 −0 README.rdoc
  2. +4 −1 lib/showoff.rb
  3. +6 −0 test/basic_test.rb
  4. +6 −0 test/fixtures/simple/one/01_slide.md
View
4 README.rdoc
@@ -166,6 +166,10 @@ definition, where tname is one of the following supported transitions:
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.
+Here's a list of other available keywords:
+
+* skip - Skips slides marked with this keyword
+
You can manage the presentation with the following keys:
* space, cursor right: next slide
View
5 lib/showoff.rb
@@ -143,6 +143,9 @@ def <<(s)
def empty?
@text.strip == ""
end
+ def skip?
+ @classes.include? 'skip'
+ end
end
@@ -171,7 +174,7 @@ def process_markdown(name, content, static=false, pdf=false)
end
end
- slides.delete_if {|slide| slide.empty? }
+ slides.delete_if {|slide| slide.empty? || slide.skip? }
final = ''
if slides.size > 1
View
6 test/basic_test.rb
@@ -24,6 +24,12 @@ def app
assert_match '<h1>My Presentation</h1>', last_response.body
end
+ test "can skip slides" do
+ get '/slides'
+ assert last_response.ok?
+ assert_no_match /Skipped slide/, last_response.body
+ end
+
test "can get asset list" do
get '/assets_needed'
assert last_response.ok?
View
6 test/fixtures/simple/one/01_slide.md
@@ -7,3 +7,9 @@
* first point
* second point
* third point
+
+!SLIDE skip
+
+# Skipped slide
+
+This won't show up

0 comments on commit e68a92b

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