Sha256: c968b135a698e7756dc56d352d78559fa1619ce94df99ce6bd44f43fc03b407c

Contents?: true

Size: 1.4 KB

Versions: 40

Compression:

Stored size: 1.4 KB

Contents

module Slideshow
  module TableHelper

# todo: add center, plus generic col helper

  
def left( opts={}, &blk )
   
  width = opts.fetch( :width, "50%" )
  clazz = opts.fetch( :class, nil )
   
  puts "  Adding HTML for left column (using table layout)..."
    
  text = capture_erb(&blk)
      
  before  = "<!-- begin left #{opts.inspect} -->\n"
  before << "<div class='#{clazz}'>\n"  if clazz  
  before << "<table width='100%'><tr><td width='#{width}' markdown='block' style='vertical-align: top;'>\n"
    
  after   = "</td>\n"  
  after  << "<!-- end left -->\n"

  html  = ""
  html << guard_block( before )
  html << text
  html << guard_block( after )

  concat_erb( html, blk.binding )
  return
end
  
def right( opts={}, &blk )

  width = opts.fetch( :width, "50%" )
  clazz = opts.fetch( :class, nil )
   
  puts "  Adding HTML for right column (using table layout)..."
    
  text = capture_erb(&blk)
    
  before  = "<!-- begin right #{opts.inspect} -->\n" 
  before << "<td width='#{width}' markdown='block' style='vertical-align: top;'>\n"  
    
  after   = "</td></tr></table>\n"
  after  << "</div>\n"  if clazz    
  after  << "<!-- end right -->\n"

  html  = ""
  html << guard_block( before )
  html << text
  html << guard_block( after )
      
  concat_erb( html, blk.binding )
  return
end
  
  
end # module TableHelper
end # module Slideshow

class Slideshow::Gen
  include Slideshow::TableHelper
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
slideshow-2.2.0 lib/slideshow/helpers/table_helper.rb
slideshow-2.1.0 lib/slideshow/helpers/table_helper.rb
slideshow-2.0.1 lib/slideshow/helpers/table_helper.rb
slideshow-2.0.0 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.5 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.4 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.3 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.2 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.1 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0.beta5 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0.beta4 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0.beta3 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0.beta2 lib/slideshow/helpers/table_helper.rb
slideshow-1.2.0.beta1 lib/slideshow/helpers/table_helper.rb
slideshow-1.1.0 lib/slideshow/helpers/table_helper.rb
slideshow-1.1.0.beta8 lib/slideshow/helpers/table_helper.rb
slideshow-1.1.0.beta7 lib/slideshow/helpers/table_helper.rb
slideshow-1.1.0.beta6 lib/slideshow/helpers/table_helper.rb
slideshow-1.1.0.beta5 lib/slideshow/helpers/table_helper.rb