fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
462 stars 155 forks source link

Add expand/collapse-all button for API doc details #920

Closed brianrourkeboll closed 3 weeks ago

brianrourkeboll commented 3 weeks ago

Addresses the other suggestion in #916.

https://github.com/fsprojects/FSharp.Formatting/assets/14795984/70041395-4893-474d-a297-7651265624c9

I have the buttons operating on the entire document. When toggled, the preference (all expanded or all collapsed) is saved to local storage. An alternative could have been to have independent expand/collapse-all buttons for each section (e.g., constructors instance members, static members, etc.), and no persistence to local storage.

To maintain parity with the behavior of the theme toggle button, I have the new button showing the state that clicking it will cause rather than the current state, even though I think I might personally prefer it the other way around.