tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

Feature request: In documentation, a section link scrolls the sidebar into view #237

Open BawdyInkSlinger opened 1 year ago

BawdyInkSlinger commented 1 year ago

Is your feature request related to a problem? A lot of the times when I am browsing documentation, it'd be easier to find the documentation if I could jump to the current section in the sidebar nav.

But if the sidebar nav isn't showing the current section, there is a moment of disorientation where I'm not sure if I'm looking for a section above or below the current nav.

Describe the solution you'd like. I'm thinking a link could be added to every documentation section that scrolls the same section in the navbar into view.

Describe alternatives you've considered. I can live without this but there are times where it would've made finding the section I'm looking for more efficient.

Additional context. Here is a screenshot to describe this feature visually image

BawdyInkSlinger commented 1 year ago

From our conversation here, TME decided the best way to implement this is probably to listen to hashchange events to scroll the sidebar into view. That way no extra links need to be added, the sidebar will always have the right table of contents in when you click on a doc link with a hash, etc.