Page MenuHomePhabricator

Add magic word to generate combined-TOC from a set of pages
Open, LowestPublic


For overview pages, portals, and the like, it is often useful to be able to explicitly include a Table of Contents generated from the sections of a set of related pages or subpages. This takes the same amount of effort as transcluding those pages, but renders far more neatly and quickly.

  • This TOC should link to the section of the appropriate page, not to a section on the current page.
  • Some reasonable section numbering scheme should be used -- perhaps ABCDE for the top-level (page-level) sections.
    • I can imagine using the page title as the top level section, which would also provide a TOC link to the "first" section of a page (the one with no anchor).

Or this could be implemented as an extension.


could output:

<div style="toc">
A. Mine
A.1 ..
A.2 ..
B. Yours
B.1 ..
C. Hers
C.1 ..
C.2 ..
C.2.1 ..
C.2.2 ..
C.3 ..

Version: unspecified
Severity: enhancement
See Also:



Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:04 PM
bzimport set Reference to bz13090.
bzimport added a subscriber: Unknown Object (MLST).

Still handy. An example of hacks to get around this (with at least 3 levels of depth), using navbars at the top of each page:

This sounds a bit like overkill for core, indeed. Moving to "extension requests".

Alternatively, you can just copy the table of contents from each - see, which implements this with scribunto