class Ronn::Document

def toc

id and +text+ is the inner text of the heading element.
as an array of +[id, text]+ tuples, where +id+ is the element's generated
Retrieve a list of top-level section headings in the document and return
def toc
  @toc ||=
    html.search('h2[@id]').map { |h2| [h2.attributes['id'], h2.inner_text] }
end