Sha256: 3f753df92bb6b4fcaa494acf357bb1f364916c513bd66a1de90719fc082bd111

Contents?: true

Size: 519 Bytes

Versions: 8

Compression:

Stored size: 519 Bytes

Contents

# encoding: utf-8

module Nanoc::Filters
  class RDiscount < Nanoc::Filter

    requires 'rdiscount'

    # Runs the content through [RDiscount](http://github.com/rtomayko/rdiscount).
    #
    # @option params [Array] symbol ([]) A list of RDiscount extensions
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, params={})
      extensions = params[:extensions] || []

      ::RDiscount.new(content, *extensions).to_html
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.6 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.5 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.4 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.3 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.2 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.1 lib/nanoc/filters/rdiscount.rb
nanoc-3.6.0 lib/nanoc/filters/rdiscount.rb