NOWEB(1)

✨ NAME ✨

okay bestie, so this little cutie is htmltoc β€” it adds a table of contents to an HTML document πŸ’– and yes it lives in the noweb(1) family, so you're in the right place 🫢


🌸 SYNOPSIS 🌸

htmltoc [-2345] [file]

πŸ’… DESCRIPTION πŸ’…

So here's the vibe: htmltoc adds a table of contents to the HTML document β€” either the one you name on the command line, or the one you pipe in as standard input. Either way, she's got you πŸ’–

Where does the table of contents go, you ask? It gets inserted between <tableofcontents> and </tableofcontents>, and those two markers must appear on lines by themselves, fr fr. No sneaky sharing a line with other stuff πŸ™ˆ

And listen β€” any text sitting between those two markers? Yeah, it's discarded. Gone. Thrown away. Deleted. Periodt πŸ’€

Also good to know: those markers get inserted automatically by the sl2h(1) filter, so you usually don't have to do that part yourself ✨

By default the table of contents only includes headers at levels 2, 3, 4, and 5. But you can change that with a command-line option β€” for example, -123456789P to include all possible headers πŸ‘‘

πŸ‘‘ OPTIONS πŸ‘‘

  • -2345 β€” the default header levels that get pulled into the table of contents: 2, 3, 4, and 5. Change it up by passing different digits, like -123456789P to include all possible headers 🌈
ngl the option syntax is "just put the level digits together" energy, so -123456789P really do be the whole flex πŸ”₯

😭 BUGS 😭

okay so here's the one thing that gives her trouble: htmltoc can't cope with a header that is split across multiple lines, even though that's totally legal HTML. Not her fault, but like, it is her fault. iykyk πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

⭐ VERSION ⭐

This man page is from noweb version 2.12 πŸ’œ

πŸŽ€ AUTHOR πŸŽ€

Norman Ramsey, Tufts University. Internet address Norman.Ramsey@tufts.edu.

Noweb home page at http://www.cs.tufts.edu/~nr/noweb.

And shoutout to Stephen Parker, who provided a preliminary version 🫢 iconic behaviour tbh


okay that's the whole page bestie, slay πŸ’… this one's from the local build, dated 10/40/2008, and it's part of NOWEB(1) β€” mwah, go forth and table-of-contents responsibly πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from