Class: Webgen::ContentProcessor::Haml
- Inherits:
-
Object
- Object
- Webgen::ContentProcessor::Haml
- Defined in:
- lib/webgen/contentprocessor/haml.rb
Overview
Processes content in Haml markup using the haml library.
Instance Method Summary collapse
-
#call(context) ⇒ Object
Convert the content in
hamlmarkup to HTML.
Instance Method Details
#call(context) ⇒ Object
Convert the content in haml markup to HTML.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/webgen/contentprocessor/haml.rb', line 7 def call(context) require 'haml' locals = { :context => context, :node => context.content_node, :ref_node => context.ref_node, :dest_node => context.dest_node, } context.content = ::Haml::Engine.new(context.content, :filename => context.ref_node.absolute_lcn). render(Object.new, locals) context rescue Exception => e raise RuntimeError, "Error converting Haml markup to HTML in <#{context.ref_node.absolute_lcn}>: #{e.message}", e.backtrace end |