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