I want a multi-level TOC which allows expanding/collapsing an entry. I vaguely recall having accomplished that in the past.

I want to accomplish what PDF routinely does, expand/collapse TOC display by clicking on a caret to left of the section heading.

For example, I was recently referred to
   "The beginner’s handbook / Debian without headaches".
HTML at https://debian-beginners-handbook.tuxfamily.org/bookworm-
en/the_beginners_handbook.html
PDF at https://download.tuxfamily.org/debianbegin/the_beginners_handbook.pdf

The PDF's index can be collapsed to 14 lines.
The HTML index is over 25 times as long at 460 single spaced lines.
Understand why ability to collapse a TOC/Index is attractive?

I have background in neither CSS nor JavaScript. I'll need examples.
TIA

Reply via email to