Sha256: 9b63b799f289678aa67e9f78a2b445bfc95a36c7477c01d0d63abbc597c81af1
Contents?: true
Size: 708 Bytes
Versions: 3
Compression:
Stored size: 708 Bytes
Contents
module Nanoc::Filters # @since 3.2.0 # # @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.0.0 | lib/nanoc/filters/slim.rb |
nanoc-4.0.0rc3 | lib/nanoc/filters/slim.rb |
nanoc-4.0.0rc2 | lib/nanoc/filters/slim.rb |