Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to skip individual slides #185

Merged
merged 1 commit into from
Jan 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
* first point
* second point
* third point

!SLIDE skip

# Skipped slide

This won't show up