Class: RDoc::Rouge::Formatter
- Inherits:
-
Markup::ToHtml
- Object
- Markup::ToHtml
- RDoc::Rouge::Formatter
- Defined in:
- lib/rdoc/rouge/formatter.rb
Instance Method Summary collapse
- #accept_verbatim(verbatim) ⇒ Object
-
#initialize(options = {}) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
Instance Method Details
#accept_verbatim(verbatim) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# 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 |