lib/amber/render/table_of_contents.rb
def populate_node(node, options)
      @children.each do |item|
        li = node.document.create_element("li")
        li.add_child(li.document.create_element("a", item.text, :href => "#{options[:href_base]}##{item.anchor}"))
        if item.children.any?
          ul = li.document.create_element(options[:tag])
          item.populate_node(ul, options)
          li.add_child(ul)
        end
        node.add_child(li)
      end
    end
def populate_node(node, options)
      @children.each do |item|
        li = node.document.create_element("li")
        li.add_child(li.document.create_element("a", item.text, :href => "#{options[:href_base]}##{item.anchor}"))
        if item.children.any?
          ul = li.document.create_element(options[:tag])
          item.populate_node(ul, options)
          li.add_child(ul)
        end
        node.add_child(li)
      end
    end
generates nokogiri html node tree from this toc