Author: alpeterson
Description:
MediaWiki generally generates a table of contents with the headings of all [sub]sections. It allows disabling ToC generation and excluding sections below a certain level (for example sections of level 4 and above), but as of MediaWiki 1.43, it does not allow displaying a ToC which only excludes specific sections (at least without changes to the MediaWiki installation). This example page shows a section whose headings should not appear in the ToC (under the "distinct words under the same token" heading), which hurts readability (and accessibility) by not only polluting the ToC, but making it semantically incorrect. An (opt-in) way to exclude given headings from the ToC, or all subsections of a given section from the [main] ToC would facilitate documentation.
Workaround
In ancient MediaWiki versions, declaring headers using HTML tags in the wikitext would not generate ToC entries. Old comments in this ticket and its original description, written on 2006-07-06 and quoted below, refer to this old behavior. The behavior was intentionally changed in 2006 (or 2005), so the old behavior is no longer available to workaround, except in instances which enable raw HTML. In these, heading elements within html pseudo-elements are not parsed (as documented in the ToC manual page’s lede).
A few pages out there have extra headers that should not show in the table of contents.
If there are excessive points, or what not, or if somebody just want to have an extra header for some reason..
eitherway, I suspected that the change from 1.6 to 1.7 made it so that <h3>stuff</h3> now shows up in the table of contents... if the person wanted it to be in the table of contents, they would have written ===stuff===
…but then I went to gentoo-wiki.org and found that their 1.6.2 also does the same thing.
I'm not sure where the change went...
if my claiming that the behavior changed is wrong (I can't verify really old versions) I submit that there needs to be a nice way to have headers not be listed in the table of contents.. other than by using the nowiki tag..
Documentation:
- Excluding subsections from TOC (Meta-Wiki)
- Excluding headings from the TOC (Wikibooks)
Questions: