_plugins/sidepanel_toc_generator.rb
# Returns an enumerator of all H2s "belonging" to an H1
Returns an enumerator of all H2s "belonging" to an H1
Returns an enumerator of all H2s " belonging " to an H1
def subheadings(el, tag_name)
    tag_index = @@headings.index(tag_name)
    Enumerator.new do |y|
      next_el = el.next_sibling
      while next_el && next_el.name != tag_name
        if next_el.name == @@headings[tag_index + 1] || next_el.name == @@headings[tag_index + 2]
          y << next_el
        end
        next_el = next_el.next_sibling
      end
    end
  end
def subheadings ( el , tag_name ) tag_index = @@headings . index ( tag_name ) Enumerator . new do | y | next_el = el . next_sibling while next_el && next_el . name != tag_name if next_el . name == @@headings [ tag_index + 1 ] || next_el . name == @@headings [ tag_index + 2 ] y << next_el end next_el = next_el . next_sibling end end end
Returns an enumerator of all H2s "belonging" to an H1
Returns an enumerator of all H2s " belonging " to an H1
el
<not_specific>
tag_name
<not_specific>