Module: Slideshow::SlideFilter
- Included in:
- Gen
- Defined in:
- lib/slideshow/filters/slide_filter.rb
Instance Method Summary (collapse)
- - (Object) add_slide_directive_before_div_h1(content)
-
- (Object) add_slide_directive_before_h1(content)
add slide directive before h1 (tells slideshow gem where to break slides).
Instance Method Details
- (Object) add_slide_directive_before_div_h1(content)
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/slideshow/filters/slide_filter.rb', line 41 def ( content ) = 0 content.gsub!( /<div[^>]*>\s*<h1/ ) do |match| += 1 "\n<!-- _S9SLIDE_ -->\n#{Regexp.last_match(0)}" end puts " Adding #{} slide breaks (using div_h1 rule)..." content end |
- (Object) add_slide_directive_before_h1(content)
add slide directive before h1 (tells slideshow gem where to break slides)
e.g. changes: <h1 id='optional' class='optional'>
to
html comment -> _S9SLIDE_ (note: rdoc can't handle html comments?)
<h1 id='optional' class='optional'>
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/slideshow/filters/slide_filter.rb', line 13 def ( content ) # mark h1 for getting wrapped into slide divs # note: use just <h1 since some processors add ids e.g. <h1 id='x'> = 0 content.gsub!( /<h1/ ) do |match| += 1 "\n<!-- _S9SLIDE_ -->\n#{Regexp.last_match(0)}" end puts " Adding #{} slide breaks (using h1 rule)..." content end |