Parent

Methods

Class/Module Index [+]

Quicksearch

Nanoc::Filters::Slim

@since 3.2.0

Public Instance Methods

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

Runs the content through [Slim](slim-lang.com/). This method takes no options.

@param [String] content The content to filter

@return [String] The filtered content

# File lib/nanoc/filters/slim.rb, line 15
def run(content, params={})
  params = {
    :disable_capture => true,      # Capture managed by nanoc
    :buffer          => '_erbout', # Force slim to output to the buffer used by nanoc
  }.merge params

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

  ::Slim::Template.new(params) { content }.render(context) { assigns[:content] }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.