wml::std::toc(3)

πŸ“¦
version 2.32.0 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

πŸ’– 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 types 1, A, a, i and I
  • whereas style=ul provides d, c and s for 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.com
    • www.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