Class: Swordfish::Node::Footnote
- Defined in:
- lib/swordfish/nodes/footnote.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#append, #clear_children, #find_nodes_by_type, #inform!, #initialize, #replace, #replace_with, #stylize, #wrap_children
Constructor Details
This class inherits a constructor from Swordfish::Node::Base
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
7 8 9 |
# File 'lib/swordfish/nodes/footnote.rb', line 7 def index @index end |
Instance Method Details
#content_to_html ⇒ Object
14 15 16 17 |
# File 'lib/swordfish/nodes/footnote.rb', line 14 def content_to_html return "" unless @index "<p><a id='footnote-#{@index}' href='#footnote-ref-#{@index}'>[#{@index}]</a> #{@children.map(&:to_html).join}</p>" end |
#to_html ⇒ Object
9 10 11 12 |
# File 'lib/swordfish/nodes/footnote.rb', line 9 def to_html return "" unless @index "<a id='footnote-ref-#{@index}' href='#footnote-#{@index}'>[#{@index}]</a>" end |