I meant to add that sadly the Table of contents (TOC) functionality can’t be done via the styled HTML. If you want fine control of the TOC you’ll need to get into XSLT. Good grief, all that ‘just’ to make a PDF. Still, massive kudos to all those who kindly made and shared this code. Otherwise the solution is pay-for and not cheap**.
** I looked at this in some depth a while back. Having chivvied Eastgate into doing HTML help out (and using Tinderbox to do it) I felt bad for those whose can’t understand who to use hypertext and need a long form document to work from, thus the above.