code: func ExtractTOC(content []byte) (newcontent []byte, toc []byte) {
  	if !bytes.Contains(content, []byte("<nav>")) {
  		return content, nil
  	}
  	origContent := make([]byte, len(content))
  	copy(origContent, content)
  	first := []byte(`<nav>
  <ul>`)
  
  	last := []byte(`</ul>
  </nav>`)
  
  	replacement := []byte(`<nav id="TableOfContents">
  <ul>`)
  
  	startOfTOC := bytes.Index(content, first)
  
  	peekEnd := len(content)
  	if peekEnd > 70+startOfTOC {
  		peekEnd = 70 + startOfTOC
  	}
  
  	if startOfTOC < 0 {
  		return stripEmptyNav(content), toc
  	}
  	// Need to peek ahead to see if this nav element is actually the right one.
  	correctNav := bytes.Index(content[startOfTOC:peekEnd], []byte(`<li><a href="#`))
  	if correctNav < 0 { // no match found
  		return content, toc
  	}
  	lengthOfTOC := bytes.Index(content[startOfTOC:], last) + len(last)
  	endOfTOC := startOfTOC + lengthOfTOC
  
  	newcontent = append(content[:startOfTOC], content[endOfTOC:]...)
  	toc = append(replacement, origContent[startOfTOC+len(first):endOfTOC]...)
  	return
  }
docs: // ExtractTOC extracts Table of Contents from content.