Sha256: 9a2a693f9b582bd19fe8f79b4e081b92b350841d002b354f269a030c52545722

Contents?: true

Size: 681 Bytes

Versions: 16

Compression:

Stored size: 681 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/content_processor'
webgen_require 'haml'

module Webgen
  class ContentProcessor

    # Processes content in Haml markup using the +haml+ library.
    module Haml

      # Convert the content in +haml+ markup to HTML.
      def self.call(context)
        context.content = ::Haml::Engine.new(context.content, :filename => context.ref_node.alcn).
          render(Object.new, :context => context)
        context
      rescue ::Haml::Error => e
        line = (e.line ? e.line + 1 : Webgen::Error.error_line(e))
        raise Webgen::RenderError.new(e, 'content_processor.haml', context.dest_node, nil, line)
      end

    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/content_processor/haml.rb
webgen-1.7.2 lib/webgen/content_processor/haml.rb
webgen-1.7.1 lib/webgen/content_processor/haml.rb
webgen-1.7.0 lib/webgen/content_processor/haml.rb
webgen-1.6.0 lib/webgen/content_processor/haml.rb
webgen-1.5.2 lib/webgen/content_processor/haml.rb
webgen-1.5.1 lib/webgen/content_processor/haml.rb
webgen-1.5.0 lib/webgen/content_processor/haml.rb
webgen-1.4.1 lib/webgen/content_processor/haml.rb
webgen-1.4.0 lib/webgen/content_processor/haml.rb
webgen-1.3.0 lib/webgen/content_processor/haml.rb
webgen-1.2.1 lib/webgen/content_processor/haml.rb
webgen-1.2.0 lib/webgen/content_processor/haml.rb
webgen-1.1.0 lib/webgen/content_processor/haml.rb
webgen-1.0.0 lib/webgen/content_processor/haml.rb
webgen-1.0.0.beta3 lib/webgen/content_processor/haml.rb