Alas, that still doesn’t give me part numbers for HTML. For example: http://exploringjs.com/impatient-js/toc.html
I’ve written the following filter which mostly does what I want (minus some polish): https://gist.github.com/rauschma/7f631cacad55b8b6c920b9334f711244
- For LaTeX, I would track section numbers and generate the chapter TOCs the same way. But I would leave the numbering of headings to LaTeX.