Class: Malt::Format::RHTML

Inherits:
Abstract show all
Defined in:
lib/malt/formats/rhtml.rb

Overview

RHTML is a variant of Erb files which are limited to conversion to HTML.

Instance Attribute Summary

Attributes inherited from Abstract

#options

Instance Method Summary collapse

Methods inherited from Abstract

#default, #engine, engine, extensions, #extensions, #file, file_extension, #file_read, #file_type, #parse_type_from_data, #refile, register, #render, #render_into, #rendering_parameters, #scope_vs_data, #subtype, #text, #to, #to_default, #to_s, #type, #with, #with!

Instance Method Details

#html(*data, &content) ⇒ Object



33
34
35
36
# File 'lib/malt/formats/rhtml.rb', line 33

def html(*data, &content)
  render_into(:html, *data, &content)
  #render_engine.render(:text=>text, :file=>file, :data=>data, :to=>:html, &yld)
end

#to_html(*data, &yld) ⇒ Object



39
40
41
42
43
# File 'lib/malt/formats/rhtml.rb', line 39

def to_html(*data, &yld)
  text = html(data, &yld)
  opts = options.merge(:text=>text, :file=>refile(:html), :type=>:html)
  HTML.new(opts)
end