Generates a table of content when a [TOC] marker is found.