Sha256: e9d9f5902570cac1c94f25d315d605fb370e1d6a6561a7f62f6076f7ec700629

Contents?: true

Size: 609 Bytes

Versions: 4

Compression:

Stored size: 609 Bytes

Contents

# encoding: utf-8

module Nanoc::Filters
  # @api private
  class Kramdown < Nanoc::Filter
    requires 'kramdown'

    # Runs the content through [Kramdown](http://kramdown.gettalong.org/).
    # Parameters passed to this filter will be passed on to Kramdown.
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, params = {})
      document = ::Kramdown::Document.new(content, params)

      document.warnings.each do |warning|
        $stderr.puts "kramdown warning: #{warning}"
      end

      document.to_html
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-4.0.0b2 lib/nanoc/filters/kramdown.rb
nanoc-4.0.0b1 lib/nanoc/filters/kramdown.rb
nanoc-4.0.0a2 lib/nanoc/filters/kramdown.rb
nanoc-4.0.0a1 lib/nanoc/filters/kramdown.rb