Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid  HTML table-of-contents generator  by
John M. Dlugosz (Monsignor) on Jul 01, 2003 at 17:50 UTC
( #270569=perlquestion: print w/ replies, xml ) Need Help??
Many years ago, I wrote a small Perl program that scans a hand-
written HTML file and generates/updates a table of contents at
the top of the file, with links to the various H\d tags.  That
was fairly crude, being line-oriented and required that the
header tags and matching names be just so. But it did recognise
the stuff it generated before and replaced it with a refreshed
copy.  I'd like something modern that does this. A proper HTML
parser would take any HTML without relying on special formatting
conventions or restrictions. The generated table of contents can
have fancy dynamic-expanding/collapsing features.  Someone has
got to have done this already! Where can I find it?   Comment on
HTML table-of-contents generator Re: HTML table-of-contents
generator by tcf22 (Pries