Sha256: 6945622313d6b744216c323126ed3d1052a1783954865c95bcb4abf65792cd9a

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

# Render text via the Haml library
if try_require('haml', 'haml')

  Webby::Filters.register :haml do |input, cursor|
    opts = ::Webby.site.haml_options.merge(cursor.page.haml_options || {})
    opts = opts.symbolize_keys
    b = cursor.renderer.get_binding
    Haml::Engine.new(input, opts).to_html(b)
  end

# Otherwise raise an error if the user tries to use haml
else
  Webby::Filters.register :haml do |input, cursor|
    raise Webby::Error, "'haml' must be installed to use the haml filter"
  end
end

# EOF

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dysinger-webby-0.9.4 lib/webby/filters/haml.rb
mikker-webby-0.9.4 lib/webby/filters/haml.rb