Sha256: 16791bc2fa9c298b1d33a22b9a2546718c89fe10c00fee1b8a7536119490b536

Contents?: true

Size: 626 Bytes

Versions: 8

Compression:

Stored size: 626 Bytes

Contents

# encoding: utf-8

require 'redcarpet'

module Nanoc3::Filters

  # @since 3.2.0
  class Redcarpet < Nanoc3::Filter

    # Runs the content through [Redcarpet](https://github.com/tanoku/redcarpet/).
    # This method optionally takes processing options to pass on to Redcarpet.
    #
    # @param [String] content The content to filter
    #
    # @option params [Array] :options ([]) A list of options to pass on to
    #   Redcarpet
    #
    # @return [String] The filtered content
    def run(content, params={})
      options = params[:options] || []

      ::Redcarpet.new(content, *options).to_html
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc3-3.2.4 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.3 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.2 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.1 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.0 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.0b3 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.0b2 lib/nanoc3/filters/redcarpet.rb
nanoc3-3.2.0b1 lib/nanoc3/filters/redcarpet.rb