Sha256: a7b4ecc5c2c854f67691a20455804d859632a9a5b93621db821220ebbdc532c0

Contents?: true

Size: 607 Bytes

Versions: 4

Compression:

Stored size: 607 Bytes

Contents

# encoding: utf-8

module Nanoc::Filters
  # @api private
  class RDoc < Nanoc::Filter
    requires 'rdoc'

    def self.setup
      gem 'rdoc', '~> 4.0'
      super
    end

    # Runs the content through [RDoc::Markup](http://docs.seattlerb.org/rdoc/RDoc/Markup.html).
    # This method takes no options.
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, _params = {})
      options = ::RDoc::Options.new
      to_html = ::RDoc::Markup::ToHtml.new(options)
      ::RDoc::Markup.new.convert(content, to_html)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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