Page MenuHomePhabricator

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

Description

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.

<aggregatetoc>
Mine
Yours
Hers
</aggregatetoc>

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 ..
</div>


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=18508

Details

Reference
bz13090

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: http://wiki.laptop.org/go/HIG

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 https://en.wikipedia.org/w/index.php?oldid=905693818, which implements this with scribunto

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM
Aklapper removed a subscriber: wikibugs-l-list.