class RDoc::Rouge::Formatter

Public Class Methods

new(options={}) click to toggle source
Calls superclass method
# File lib/rdoc/rouge/formatter.rb, line 7
def initialize(options={})
  opts = ::RDoc::Options.new
  opts.pipe = options.delete(:pipe) || false

  super opts, nil
end

Public Instance Methods

accept_verbatim(verbatim) click to toggle source
# File lib/rdoc/rouge/formatter.rb, line 14
def accept_verbatim verbatim
  text = verbatim.text.rstrip

  lexer = ::Rouge::Lexer.find_fancy(verbatim.format.to_s, text) || ::Rouge::Lexers::Text

  formatter = ::Rouge::Formatters::HTML.new(
    :css_class => "highlight #{lexer.tag}"
  )

  @res << formatter.format(lexer.lex(text))
end