lib/webby/filters/outline.rb
# Returns information for the given heading element. The information is
# returned as a two element array: [text, id].
#
# This method will also insert outline numbering and an id attribute. The
# outline numbering can be disabled, but the id attribute must be present
# for TOC generation.
#
Returns information for the given heading element. The information is
returned as a two element array: [text, id].

This method will also insert outline numbering and an id attribute. The
outline numbering can be disabled, but the id attribute must be present
for TOC generation.
Returns information for the given heading element . The information is returned as a two element array : [ text id ] . This method will also insert outline numbering and an id attribute . The outline numbering can be disabled but the id attribute must be present for TOC generation .
def heading_info( elem )
    m = @h_rgxp.match(elem.name)
    level = Integer(m[1])
    self.current_level = level
    text = elem.inner_text
    lbl = label
    if numbering?
      elem.children.first.before {tag!(:span, lbl, :class => 'heading-num')}
    end
    elem['id'] = "h#{lbl.tr('.','_')}" if elem['id'].nil?
    return [text, elem['id']]
  end
def heading_info ( elem ) m = @h_rgxp . match ( elem . name ) level = Integer ( m [ 1 ] ) self . current_level = level text = elem . inner_text lbl = label if numbering? elem . children . first . before { tag! ( :span , lbl , :class => 'heading-num' ) } end elem [ 'id' ] = "h#{lbl.tr('.','_')}" if elem [ 'id' ] . nil? return [ text , elem [ 'id' ] ] end
Returns information for the given heading element.
Returns information for the given heading element .
elem