Class: Jazzy::Highlighter::Formatter
- Inherits:
-
Rouge::Formatters::HTML
- Object
- Rouge::Formatters::HTML
- Jazzy::Highlighter::Formatter
- Defined in:
- lib/jazzy/highlighter.rb
Instance Method Summary collapse
-
#initialize(language) ⇒ Formatter
constructor
A new instance of Formatter.
- #stream(tokens) {|"<pre class=\"highlight #{@language}\"><code>"| ... } ⇒ Object
Constructor Details
#initialize(language) ⇒ Formatter
Returns a new instance of Formatter.
7 8 9 10 |
# File 'lib/jazzy/highlighter.rb', line 7 def initialize(language) @language = language super() end |
Instance Method Details
#stream(tokens) {|"<pre class=\"highlight #{@language}\"><code>"| ... } ⇒ Object
12 13 14 15 16 |
# File 'lib/jazzy/highlighter.rb', line 12 def stream(tokens, &b) yield "<pre class=\"highlight #{@language}\"><code>" super yield "</code></pre>\n" end |