Sha256: 00ebb73529adf312b324399c7dc269755000ef25040a07cdd7d24de7a140d2ae

Contents?: true

Size: 514 Bytes

Versions: 15

Compression:

Stored size: 514 Bytes

Contents

# encoding: utf-8

require 'rdiscount'

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

    # 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

15 entries across 15 versions & 1 rubygems

Version Path
nanoc-3.5.0 lib/nanoc/filters/rdiscount.rb
nanoc-3.5.0b2 lib/nanoc/filters/rdiscount.rb
nanoc-3.5.0b1 lib/nanoc/filters/rdiscount.rb
nanoc-3.4.3 lib/nanoc/filters/rdiscount.rb
nanoc-3.4.2 lib/nanoc/filters/rdiscount.rb
nanoc-3.4.1 lib/nanoc/filters/rdiscount.rb
nanoc-3.4.0 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.7 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.6 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.5 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.4 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.3 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.2 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.1 lib/nanoc/filters/rdiscount.rb
nanoc-3.3.0 lib/nanoc/filters/rdiscount.rb