Opened 3 years ago

#3321 new enhancement

Limit TOC depth on wiki

Reported by: wenzeslaus Owned by: grass-dev@…
Priority: minor Milestone: Website
Component: Website Version: unspecified
Keywords: wiki TOC CSS Cc:
CPU: Unspecified Platform: Unspecified

Description

I would like to be able limit TOC depth on the GRASS (user) wiki. The documentation says "To customize this for individual pages, the TOC can be enclosed in an element with class toclimit-<limit>, if the appropriate CSS rules are defined in the pages CSS." And suggests the following CSS which I don't see in

https://grasswiki.osgeo.org/w/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.page.gallery.styles%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector

/*
 * Allow limiting of which header levels are shown in a TOC;
 * <div class="toclimit-3">, for instance, will limit to
 * showing ==headings== and ===headings=== but no further.
 * Used in [[Template:TOC]]
 */
.toclimit-2 .toclevel-1 ul,
.toclimit-3 .toclevel-2 ul,
.toclimit-4 .toclevel-3 ul,
.toclimit-5 .toclevel-4 ul,
.toclimit-6 .toclevel-5 ul,
.toclimit-7 .toclevel-6 ul {
        display: none;
}

https://www.mediawiki.org/wiki/Manual:Table_of_contents

https://www.mediawiki.org/wiki/MediaWiki:Gadget-site.css

Wikipedia uses the following template:

<div class="toclimit-{{{1|{{{limit|3}}}}}}">__TOC__</div><noinclude>
{{documentation}}
</noinclude>

https://en.wikipedia.org/w/index.php?title=Template:TOC_limit&action=edit

Change History (0)

Note: See TracTickets for help on using tickets.