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.
12 13 14 15 |
# File 'lib/jazzy/highlighter.rb', line 12 def initialize(language) @language = language super() end |
Instance Method Details
#stream(tokens) {|"<pre class=\"highlight #{@language}\"><code>"| ... } ⇒ Object
17 18 19 20 21 |
# File 'lib/jazzy/highlighter.rb', line 17 def stream(tokens, &block) yield "<pre class=\"highlight #{@language}\"><code>" super yield "</code></pre>\n" end |