Parent

Methods

Class 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 11
11:     def call(context)
12:       require 'haml'
13: 
14:       locals = {:context => context}
15:       context.content = ::Haml::Engine.new(context.content, :filename => context.ref_node.alcn).
16:         render(Object.new, locals)
17:       context
18:     rescue LoadError
19:       raise Webgen::LoadError.new('haml', self.class.name, context.dest_node, 'haml')
20:     rescue ::Haml::Error => e
21:       line = if e.line
22:                e.line + 1
23:              else
24:                Webgen::Common.error_line(e)
25:              end
26:       raise Webgen::RenderError.new(e, self.class.name, context.dest_node, context.ref_node, line)
27:     rescue Exception => e
28:       raise Webgen::RenderError.new(e, self.class.name, context.dest_node,
29:                                     Webgen::Common.error_file(e), Webgen::Common.error_line(e))
30:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.