This tool generates a neat, nested table of contents based on the titles in the file you give it, and outputs it to standard out. My command looks something like:
Capture the output, put it at the top of your file, and you are all set! For example, a Go SDK project I was working on recently. It’s such a small thing but it improves user experience and only takes a moment. When it’s time to update, just delete what you have and regenerate a new one!
Also published on Medium.