See also the official documentation:
Help Center > Members Manual > Working with wiki pages > Organizing wiki pages
A wiki page can be just a few paragraphs of information, or it can hold a substantial document. As with any document, when it gets longer, it helps to have some organization to the information.
Using Header styles helps the author organize the information.
Having an automatically maintained Table of Contents allows the reader to quickly find the desired section of the document and also create a link to the section.
As a GMF member, you can help by adding to or correcting this article, or ask/comment in GMF@'s messages.
The Table of Contents ("ToC") feature works in conjunction with the paragraph format styles Header 1 through Header 6. As a result, it is available in wiki pages authored in HTML and Markdown, but not in Plain Text. This paragraph is in normal style, but the line above ("Overview") has been marked with Header 1 style. That style uses a larger default font size and is automatically included in the ToC.
Besides a text header, the heading to be included in the ToC box can also be a link (an external web link, a link to another wiki page, or a link to just about anywhere.) What is displayed in the ToC is the header text on the wiki page (i.e., the "Text to display" when creating the link.) However, that text may not be a URL (i.e., http:\\google.com, www.goodle.com, or even a shortened URL such as google.com.) If the header is an actual URL, the ToC will not work correctly (the entry in the ToC will be dead instead of jumping to the header location on the wiki page.) For example, a header link (say to google.com) with the header text being "Google Link" would work just fine in the ToC. But the header text "Google.com" will not work correctly in the ToC.
Pages that use the ToC allow you to not only mention the location of information but allow you to create a link right to a subtopic on a page. Here are examples linking to subtopics on the home page of this wiki:
Note: Putting a preamble above the ToC, as this page has, makes the page easier to read and looks much better if you make it a Sticky Wiki Page
One of the weaknesses of the current ToC implementation in HTML pages is that it does not operate in a What You See Is What You Get ("WYSIWYG") fashion. That is, while you are in the edit mode for a page, when you use the ToC button to insert a ToC, you will not see the generated ToC; instead, you will see only a text marker, something that looks like this:
[TOC:Example Table of Contents:1]
NOTE: The text of the ToC should be in paragraph format (not heading format) or it looks really funky. Check the formatting style.
When you save the page, that marker will be converted into the filled-in and formatted ToC.
Once you've inserted the ToC marker into the page, do not use the button to update or edit the marker. Instead edit the marker itself (it is just text in the editor). This is another way in which the current implementation is not WYSIWYG. A future improvement to the ToC feature might change this.
When working in Markdown pages, or as a work-round to issues with the ToC button in HTML pages, you can simply type the ToC marker. Follow the format shown above, with the keyword TOC, the title, and the header depth separated by colons and inside of square brackets.
When you format text as a heading, a default font size is applied; however, once you apply the header style/level (through the Formats dropdown, i.e., h1, h2, h3...), you can modify its format, i.e., how the heading appears on the wiki page (font family, pt size, bolded, italicized, etc.). How a heading appears on the wiki page does not affect how the heading appears in the ToC block itself - that display box does not pick up the formatting of each heading. You can, however, format how the ToC box itself appears using the basic text formatting tools (bold, italic) but not the extended formatting toolbar (font family, pt size, etc.). For example, go back and look: the ToC for this page was formatted as italic (by formatting the line [TOC:Example Table of Contents:1] as italic.
When using a ToC, always start using Header 1, even if it looks too big; otherwise, the ToC doesn't appear properly. Subtopics should decrease by next smaller size:
Table of Contents feature in wiki pages, beta@ #6948, Mark Fletcher, 2016-03-28
Basic writing and formatting syntax, GitHub-Flavored Markdown.
A few tips:
Applying Bold and/or Italic to the marker will follow thru to the ToC display.
You MAY use (most?) special characters in a header (e.g., This Chapter (1, 2, & 3) BUT NOT a period (e.g., This Chapter (1., 2., & 3.) The header will display in the ToC, but clicking the line will not jump to that header.
”Contents:” in the ToC placeholder can be replaced with custom text (e.g., “In This Wiki Article::” - add an extra colon if you want one to display.)
Advanced hamburger-level formatting (font family-size-color-etc.) does not follow thru to the ToC display. Nor does bulleting.
The ToC marker doesn't need to be in any particular location - it can be (although dumb) the last line of the page.
One and done -- duplicated ToC markers are treated as just another line of text.
Formatting a link as a header will display in the ToC, Clicking that ToC line, jumps to that location on the wiki page (doesn't open the link itself.) HOWEVER for that to work, the line (Text to display in the link) cannot be written as a link. ie, a "GOOGLE LINK" header behaves as I describe, but a "GOOGLE.COM" header will not work. The header GOOGLE.COM will display in the ToC but the line will be dead (not jump to location #GOOGLE.COM on the wiki page.)
Link checking your wiki
There are extensions for Firefox for checking links:
If you are unfamiliar with the process of installing an extension, Wiki Link Checking explains it step by step