Last modified: 2011-09-20 15:01:48 UTC
There should be a toc= or TOC= parameter ( http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php ) to force a table of contents. That way one could get a TOC, without needing to edit or even editing permission, nor mess up ones preferences or even register an account. Indeed, one can't even force it via preferences, as all there is is "[x] Show table of contents (for pages with more than 3 headings)" You see sometimes one might want to a table of contents even if there are only two items. And one shouldn't need write permissions on a site to see it. E.g., when one wants to copy the anchors with ones mouse, without needing to dig them out of the HTML page source. Let's see, TOC=true, TOC=false are needed, (and maybe even TOC=4 TOC=4,11 etc. which I suppose could be a range of what items to show... OK, never mind that.)
This isn't currently possible. The TOC is generated by the parser, which *must not* be dependent on query parameters from WebRequest.
index.php is intended for end-users only, users must not be forced to type some obscure parameters to get to some obscure functionality. On the other hand, we have a rich machine-readable interface that can do this: http://www.mediawiki.org/w/api.php?action=parse&page=API:Parsing_wikitext&prop=sections
Gosh, that API result still is nowhere easier for the average user to obtain or cut and paste usable URLs from. OK, I have come up with the Final Solution, Bug 31039.