Class: Marker::Numbered

Inherits:
ParseNode show all
Defined in:
lib/marker/lists.rb

Instance Method Summary collapse

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#phraseObject

– defaults ++



137
138
139
# File 'lib/marker/lists.rb', line 137

def phrase
  nil
end

#structureObject



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( options = {} )
  "<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( options = {} )
  indent = (options[:indent] || 0)
  '    ' * (indent > 0 ? indent - 1 : 0) +
  "#{'%2d' % options[:num]}. #{phrase.to_s( options )}"
end