Class: RevealCK::Builders::IndexHtml

Inherits:
Object
  • Object
show all
Includes:
Retrieve
Defined in:
lib/reveal-ck/builders/index_html.rb

Overview

Public: An IndexHtml knows how to build the index.html file (the core slides) within a reveal.js presentation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Retrieve

included, #retrieve

Constructor Details

#initialize(args) ⇒ IndexHtml

Returns a new instance of IndexHtml.



14
15
16
17
18
# File 'lib/reveal-ck/builders/index_html.rb', line 14

def initialize(args)
  @template = retrieve(:template, args)
  @slides_html = retrieve(:slides_html, args)
  @config = retrieve(:config, args)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/reveal-ck/builders/index_html.rb', line 12

def config
  @config
end

#slides_htmlObject (readonly)

Returns the value of attribute slides_html.



12
13
14
# File 'lib/reveal-ck/builders/index_html.rb', line 12

def slides_html
  @slides_html
end

#templateObject (readonly)

Returns the value of attribute template.



12
13
14
# File 'lib/reveal-ck/builders/index_html.rb', line 12

def template
  @template
end

Instance Method Details

#renderObject



20
21
22
23
24
25
26
27
# File 'lib/reveal-ck/builders/index_html.rb', line 20

def render
  scope = RevealCK::Render::Scope.new(dir: Dir.pwd, config: config)
  tilt_template = Tilt.new(template)
  locals = {
    slides_html: slides_html
  }
  tilt_template.render(scope, locals)
end