documentation: improve html anchors

This improves the linkability of headings in the HTML documentation.

It's supplementary to the existing links, and is at best a partial solution -
but I think it's useful enough to have.

@hjoliver, please review.