class RDoc::Rouge::Renderer

Attributes

formatter[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/rdoc/rouge.rb, line 11
def initialize(options={})
  @formatter = if options.delete(:toc)
                 Rouge::TOC.new
               else
                 Rouge::Formatter.new(options)
               end
end

Public Instance Methods

parse(text) click to toggle source
# File lib/rdoc/rouge.rb, line 19
def parse text
  html = ::RDoc::Markdown.parse(text).accept(@formatter)
  output = if @formatter.is_a? Rouge::TOC
             Rouge::TOC.to_list(html)
           else
             html
           end
end