Back to docs platform.
Just to mention, I made an experiment with template on this issue : https://developer.mozilla.org/en-US/docs/Template:quicknav It allow to add a show/hide navigation sidebar. However, A true solution to this bug requires an in deep UX work.
Yes, this would be nice to have. It will take some significant fiddling around to get it done and done right.
One of the things that dochub.io does very well, I think. http://dochub.io/#html/
It is done in APIs too.
Done for JS this year, too. HTML, SVG elements have it as well. SVG attributes: https://bugzilla.mozilla.org/show_bug.cgi?id=658789 Closing here for now. File new bugs for other areas with navigation issues.