Class: Noteman::MDProcessor::StackRenderer
- Inherits:
-
Redcarpet::Render::Base
- Object
- Redcarpet::Render::Base
- Noteman::MDProcessor::StackRenderer
- Defined in:
- lib/noteman/md_processor.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
- #header(title, level) ⇒ Object
-
#initialize ⇒ StackRenderer
constructor
A new instance of StackRenderer.
- #paragraph(text) ⇒ Object
Constructor Details
#initialize ⇒ StackRenderer
Returns a new instance of StackRenderer.
7 8 9 10 |
# File 'lib/noteman/md_processor.rb', line 7 def initialize super @items = [] end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/noteman/md_processor.rb', line 5 def items @items end |
Instance Method Details
#header(title, level) ⇒ Object
12 13 14 15 |
# File 'lib/noteman/md_processor.rb', line 12 def header(title, level) items << { :text => title, :level => level, :type => :header } "#{'#' * level} #{title}\n\n" end |
#paragraph(text) ⇒ Object
17 18 19 20 |
# File 'lib/noteman/md_processor.rb', line 17 def paragraph(text) items << { :text => text, :type => :paragraph } "#{text}\n\n" end |