Class: Deas::Kramdown::TemplateEngine

Inherits:
TemplateEngine
  • Object
show all
Defined in:
lib/deas-kramdown.rb

Instance Method Summary collapse

Instance Method Details

#compile(template_name, compiled_content) ⇒ Object

this is used when chaining engines where another engine initially loads the template file



32
33
34
# File 'lib/deas-kramdown.rb', line 32

def compile(template_name, compiled_content)
  self.kramdown_source.compile(template_name, compiled_content)
end

#kramdown_sourceObject



11
12
13
14
15
16
# File 'lib/deas-kramdown.rb', line 11

def kramdown_source
  @kramdown_source ||= Source.new(self.source_path, {
    :doc_opts => self.opts['doc_opts'],
    :cache    => self.opts['cache']
  })
end

#partial(template_name, locals, &content) ⇒ Object

Render straight markdown partial templates. As no ruby will be evaluated the locals and content block will be ignored.



26
27
28
# File 'lib/deas-kramdown.rb', line 26

def partial(template_name, locals, &content)
  self.kramdown_source.render(template_name)
end

#render(template_name, view_handler, locals, &content) ⇒ Object

Render straight markdown templates. As no ruby will be evaluated the view handler, locals and content block will be ignored.



20
21
22
# File 'lib/deas-kramdown.rb', line 20

def render(template_name, view_handler, locals, &content)
  self.kramdown_source.render(template_name)
end