Parent

Methods

Class/Module Index [+]

Quicksearch

Nanoc::Filters::Haml

Public Instance Methods

run(content, params={}) click to toggle source

Runs the content through [Haml](haml-lang.com/). Parameters passed to this filter will be passed on to Haml.

@param [String] content The content to filter

@return [String] The filtered content

# File lib/nanoc/filters/haml.rb, line 13
def run(content, params={})
  # Get options
  options = params.merge(:filename => filename)

  # Create context
  context = ::Nanoc::Context.new(assigns)

  # Get result
  proc = assigns[:content] ? lambda { assigns[:content] } : nil
  ::Haml::Engine.new(content, options).render(context, assigns, &proc)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.