Class: Rouge::Formatters::HTMLPygments
- Inherits:
-
Rouge::Formatter
- Object
- Rouge::Formatter
- Rouge::Formatters::HTMLPygments
- Defined in:
- lib/rouge/formatters/html_pygments.rb
Constant Summary
Constants inherited from Rouge::Formatter
Instance Method Summary collapse
-
#initialize(inner, css_class = 'codehilite') ⇒ HTMLPygments
constructor
A new instance of HTMLPygments.
- #stream(tokens) {|%<<pre class="#@css_class"><code>>| ... } ⇒ Object
Methods inherited from Rouge::Formatter
find, format, #format, #render, tag
Constructor Details
#initialize(inner, css_class = 'codehilite') ⇒ HTMLPygments
Returns a new instance of HTMLPygments.
4 5 6 7 |
# File 'lib/rouge/formatters/html_pygments.rb', line 4 def initialize(inner, css_class='codehilite') @inner = inner @css_class = css_class end |
Instance Method Details
#stream(tokens) {|%<<pre class="#@css_class"><code>>| ... } ⇒ Object
9 10 11 12 13 |
# File 'lib/rouge/formatters/html_pygments.rb', line 9 def stream(tokens, &b) yield %<<pre class="#@css_class"><code>> @inner.stream(tokens, &b) yield "</code></pre>" end |