Class: Rack::WebProfiler::Rouge::HTMLFormatter
- Inherits:
-
Rouge::Formatter
- Object
- Rouge::Formatter
- Rack::WebProfiler::Rouge::HTMLFormatter
- Defined in:
- lib/rack/web_profiler/rouge/html_formatter.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ HTMLFormatter
constructor
Initialize the Formatter.
- #stream(tokens) { ... } ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ HTMLFormatter
Initialize the Formatter.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rack/web_profiler/rouge/html_formatter.rb', line 8 def initialize(opts = {}) @formatter = opts[:inline_theme] \ ? ::Rouge::Formatters::HTMLInline.new(opts[:inline_theme]) : ::Rouge::Formatters::HTML.new if opts[:line_numbers] @formatter = ::Rouge::Formatters::HTMLTable.new(@formatter, opts) else @formatter = ::Rouge::Formatters::HTMLPygments.new(@formatter) end end |
Instance Method Details
#stream(tokens) { ... } ⇒ Object
21 22 23 |
# File 'lib/rack/web_profiler/rouge/html_formatter.rb', line 21 def stream(tokens, &b) @formatter.stream(tokens, &b) end |