Parent

Methods

Class/Module Index [+]

Quicksearch

Webgen::ContentProcessor::Haml

Processes content in Haml markup using the haml library.

Public Instance Methods

call(context) click to toggle source

Convert the content in haml markup to HTML.

# File lib/webgen/contentprocessor/haml.rb, line 10
def call(context)
  require 'haml'

  locals = {:context => context}
  context.content = ::Haml::Engine.new(context.content, :filename => context.ref_node.alcn).
    render(Object.new, locals)
  context
rescue LoadError
  raise Webgen::LoadError.new('haml', self.class.name, context.dest_node, 'haml')
rescue ::Haml::Error => e
  line = if e.line
           e.line + 1
         else
           Webgen::Common.error_line(e)
         end
  raise Webgen::RenderError.new(e, self.class.name, context.dest_node, context.ref_node, line)
rescue Exception => e
  raise Webgen::RenderError.new(e, self.class.name, context.dest_node,
                                Webgen::Common.error_file(e), Webgen::Common.error_line(e))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.