Sha256: 570f1cc632eb16a0215672e16ca25919c34e04becb09f9c94c5686e571a7d1ba
Contents?: true
Size: 709 Bytes
Versions: 9
Compression:
Stored size: 709 Bytes
Contents
module Webgen::ContentProcessor # Processes content in Haml markup using the +haml+ library. class Haml # Convert the content in +haml+ markup to HTML. 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 end end
Version data entries
9 entries across 9 versions & 2 rubygems