Since some people have been commenting on the table of contents situation, this is a thread to explain my plans for upcoming changes.
The status quo is that the ToC is fine except when the page has headings that skip levels. This is most easily felt if you decide that your content files should start at <h2>, so your SuperMD headings always have at least ## in front of them.
This is what it looks like:
Obviously not optimal.
A PR was submitted to try and fix this issue by detecting the “highest” heading level (or lowest numerically, depending on how you want to look at it), in order to normalize the table of contents at that level. This is done also in light of general HTML authoring best practices that say that documents should only have a single <h1> in them.
I’m not going to merge that PR for a few reasons, some of which are not relevant to this discussion, so I’ll focus on the main key point:
Even if the ToC is normalized at the top level, you will still be able to skip levels “in the middle” of it, still being able to cause breakages. For example if we have:
# title1
## title2
#### title4
### title3
This will still render like this:
And the presence of a h3 makes it problematic trying to “compact” the ToC anyway.
So my take is that heading jumps should result in a build error as that’s also nice to catch when you jump a level by mistake.
This leaves the “single h1” issue not resolved though. I have solution for that as well but I would like first to make it clear that I think that all “best practices” should be evaluated critically, and that I generally don’t agree with many of the “semantic HTML” best practices.
In particular, my understanding of the HTML spec is that it is unrealistic (and actually detrimental) to expect content authors to use headings to mark a content hierarchy reliably.
On the other hand instead, we can (and should) aim for using SuperMD headings to define a correct content hierarchy.
To put this into more concrete terms, I proposed above to make smd heading jumps a build error, but I will never agree to add a check to SuperHTML that headings in a template have no jumps.
Hopefully I’ve made it clear how to me it’s SuperMD semantics that drive HTML generation and never the other way around.
So, what do we do then wrt headings? Instead of having authors start at ## in SuperMD, we change how headings render to HTML.
SuperMD files will always start their sectioning at # and they will not allow jumps, but the HTML renderer can be configured to start at <h2> for those who care about following the advice presented by the MDN.

