wml::std::toc(3)
π wml::std::toc β Table of Contents Generation π
okay bestie, welcome to wml::std::toc(3) from the EN Tools crew β¨ this is the one that builds you a whole Table of Contents like it's nothing. no cap.
πΈ NAME πΈ
wml::std::toc β Table of Contents Generation. yes, the name literally says what it does, we love a transparent queen π
β¨ SYNOPSIS β¨
#use wml::std::toc [style={pre,nbsp,hspace,ul,ol} [type=...]]
<toc>
<hN>...</hN>
<toc_hN ...>...</toc_hN>
π¦ DESCRIPTION π¦
so here's the tea, bestie: this thing creates a table of contents, and you can drop it in anywhere you want using the <toc> tag β and lowkey you can do it more than once if that's the vibe you're going for π
The contents get built out of all your header tags, aka <hN> β and here's the cute part: that N also controls the indention in the table of contents. so <h1> is your main character energy and <h2> sits all nicely nested under it. iconic. β¨
Alternatively β plot twist! β you can use the <toc_hN> tags to insert their body (which, yes, can be empty!) at the current location and into the Table Of Contents. Two places, one tag, we love efficiency.
And if you specify it, the alt attribute gets included into the ToC instead of the body. so if your body is giving nothing, alt is your moment to shine π
π STYLES π
you've got five (5) styles to choose from, bestie, and they are: pre, nbsp, hspace, ul and ol.
the last two β ul and ol β accept special options so they can render actual HTML lists. slay.
- with
style=ol, you may choose types1,A,a,iandI - whereas
style=ulprovidesd,candsfor respectively discs, circles and squares
pick your fighter π«Ά
π EXAMPLE π
below is an example to render the Table of Contents with the HTML <pre> tag. watch this:
#use wml::std::toc style=pre
#use wml::std::page
<page>
<h1>Chapter 1</h1>
<h2>Section 1</h2>
<h2>Section 2</h2>
<h1>Chapter 2</h1>
<h2>Section 1</h2>
<h2>Section 2</h2>
<toc>
Play and choose your favorite! π₯
#use wml::std::toc style=ol type=A1ai
or
#use wml::std::toc style=ul type=dssccc
ngl the second one is giving disc-disc-square-square-circle-circle-circle and honestly? a serve π
π AUTHORS π
the legends themselves:
- Ralf S. Engelschall
rse@engelschall.comwww.engelschall.com
- Denis Barbier
barbier@engelschall.com
π REQUIRES π
- Internal:
P1,P2,P5,P6
π SEE ALSO π
the HTML <Hx> <UL> <OL> tags. yep, go read about those too, iykyk π
and that's the whole page, bestie!! this was wml::std::toc(3) from EN Tools, version dated 2020-11-29 β go build the prettiest little ToC the internet has ever seen πβ¨ bye pookie, mwah π
π¦ where this page comes from
- debian bookworm: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- debian trixie: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu jammy: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu noble: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu questing: wml 2.32.0~ds1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms