Class: Marker::Numbered
- Inherits:
-
ParseNode
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- Marker::Numbered
- Defined in:
- lib/marker/lists.rb
Instance Method Summary collapse
-
#phrase ⇒ Object
– defaults ++.
- #structure ⇒ Object
- #to_html(options = {}) ⇒ Object
- #to_s(options = {}) ⇒ Object
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#phrase ⇒ Object
– defaults ++
137 138 139 |
# File 'lib/marker/lists.rb', line 137 def phrase nil end |
#structure ⇒ Object
128 129 130 131 132 133 134 |
# File 'lib/marker/lists.rb', line 128 def structure if phrase ListBuilder.new( self, :ol ) else ListBuilder.new( list_item.structure, :ol ) end end |
#to_html(options = {}) ⇒ Object
118 119 120 |
# File 'lib/marker/lists.rb', line 118 def to_html( = {} ) "<li>#{phrase.to_html(options)}</li>" end |
#to_s(options = {}) ⇒ Object
122 123 124 125 126 |
# File 'lib/marker/lists.rb', line 122 def to_s( = {} ) indent = ([:indent] || 0) ' ' * (indent > 0 ? indent - 1 : 0) + "#{'%2d' % options[:num]}. #{phrase.to_s( options )}" end |