Trac has a built-in rendering engine as part of the bug tracker and wiki. To make it easy to use, with no knowledge of HTML, Trac uses what is known as "wiki markup" to define HTML features such as font styles, lists, tables, links, etc.
You can auto-generate a table of contents, also known as a page index or page outline, from the titles on the page with the following entries:
Page headings and the auto-generated table of contents in the upper right hand corner.
Wiki markup specifying that a table of contents be generated from the "h2" and "h3" titles. Note that the "h1" is ignored.