Generate TOC as HTML [was #14395]
The aggregator should generate a table of contents for the HTML view that can be viewed in the new portal.
Probably this will be resolved by providing a query parameter like mode=toc
to the HTML endpoint since almost everything is the same, we just need to walk along the headings.