Sha256: c8c51b52296b032595dd473b0b25eb3fc08707a5112c0c67c1202f765092472a
Contents?: true
Size: 682 Bytes
Versions: 3
Compression:
Stored size: 682 Bytes
Contents
module Nanoc::Filters # @api private class Slim < Nanoc::Filter requires 'slim' # Runs the content through [Slim](http://slim-lang.com/). # This method takes no options. # # @param [String] content The content to filter # # @return [String] The filtered content 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::Int::Context.new(assigns) ::Slim::Template.new(params) { content }.render(context) { assigns[:content] } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nanoc-4.4.7 | lib/nanoc/filters/slim.rb |
nanoc-4.4.6 | lib/nanoc/filters/slim.rb |
nanoc-4.4.5 | lib/nanoc/filters/slim.rb |