class Slideshow::Service

Constants

PUBLIC_FOLDER
VIEWS_FOLDER

Private Instance Methods

render_slideshow( text, template_path ) click to toggle source
# File lib/slideshow/service.rb, line 148
def render_slideshow( text, template_path )

 opts    = Slideshow::Opts.new

 ## opts.verbose      = true     # turn on (verbose) debug output
 ## opts.output_path  = "#{Slideshow.root}/tmp/#{Time.now.to_i}"

 config  = Slideshow::Config.new( opts )
 config.load
 config.dump

 b = Slideshow::Build.new( config )
 deck = b.create_deck_from_string( text )

 pp deck

 puts "content:"
 pp deck.content

 ###########################################
 ## setup hash for binding
 assigns = { 'name'    => 'test',    ## todo/check: what name to use???
            'headers' => HeadersDrop.new( b.headers ),
            'content' => deck.content,
            'slides'  => deck.slides.map { |slide| SlideDrop.new(slide) },  # strutured content - use LiquidDrop - why? why not?
           }

#
#  html = "<p>hello from s6</p>"
#  html

  ## e.g. :s6 == s6.liquid file/template

  tpl = LiquidTemplate.from_public( template_path )
  tpl.render( assigns )
end
welcome_sample() click to toggle source
# File lib/slideshow/service.rb, line 140
def welcome_sample
  ## todo: rotate welcome / use random number for index
  # place markdown docs in server/docs
   text = File.read( "#{SlideshowService.root}/lib/slideshow/service/docs/welcome.md" )
   text
end