mediawiki-skins-Citizen/templates/TableOfContents__line.mustache
alistair3149 257673a588
feat(toc): allow ToC to be collapsible
Using the same implementation as Vector 2022

Closes: #556
2024-09-10 19:32:49 -04:00

27 lines
950 B
Plaintext

<li id="toc-{{anchor}}"
class="citizen-toc-list-item citizen-toc-level-{{toclevel}}">
{{!
^linkAnchor anchor /linkAnchor is needed for MW 1.39 compatability
}}
<a class="citizen-toc-link" href="#{{linkAnchor}}{{^linkAnchor}}{{anchor}}{{/linkAnchor}}">
<div class="citizen-toc-indicator"></div>
<div class="citizen-toc-text">
<span class="citizen-toc-numb">{{number}}</span>
<span class="citizen-toc-heading">{{{line}}}</span>
</div>
</a>
{{#html-summary}}
{{{.}}}
{{/html-summary}}
{{#is-top-level-section}}{{#is-parent-section}}
<button aria-controls="toc-{{anchor}}-sublist" class="citizen-toc-toggle">
<span class="citizen-ui-icon mw-ui-icon-wikimedia-collapse"></span>
<span>{{{citizen-button-label}}}</span>
</button>
{{/is-parent-section}}{{/is-top-level-section}}
<ul id="toc-{{anchor}}-sublist" class="citizen-toc-list">
{{#array-sections}}
{{>TableOfContents__line}}
{{/array-sections}}
</ul>
</li>