Skip to content

Commit

Permalink
Merge pull request #185 from rafmagana/skip_slides
Browse files Browse the repository at this point in the history
Add ability to skip individual slides
  • Loading branch information
Matthew McCullough committed Jan 21, 2013
2 parents 492ba21 + 81a5669 commit e68a92b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.rdoc
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/showoff.rb
Expand Up @@ -143,6 +143,9 @@ def <<(s)
def empty?
@text.strip == ""
end
def skip?
@classes.include? 'skip'
end
end


Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/basic_test.rb
Expand Up @@ -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?
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/simple/one/01_slide.md
Expand Up @@ -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.