Class: Jekyll::PseudoCodeBlockB
- Inherits:
-
Liquid::Block
- Object
- Liquid::Block
- Jekyll::PseudoCodeBlockB
- Defined in:
- lib/jekyll-pseudocode-b.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ PseudoCodeBlockB
constructor
A new instance of PseudoCodeBlockB.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, text, tokens) ⇒ PseudoCodeBlockB
Returns a new instance of PseudoCodeBlockB.
17 18 19 20 21 |
# File 'lib/jekyll-pseudocode-b.rb', line 17 def initialize(tag_name, text, tokens) super @brush = PseudoCodeB::HtmlBrush.new @grammar = PseudoCodeB::Grammar.new end |
Instance Method Details
#render(context) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/jekyll-pseudocode-b.rb', line 25 def render(context) @text = super # for some reason is adding a line to initial code # let's removes @text = @text.remove_lines(1) @formatted = @grammar.format(@text, @brush) "<div class='pseudocode'>#{@formatted}</div>" end |