expand all at once button for wiki/Documentation


Please see:

Any idea on how to add an expand all button (so not each one has to be manually clicked)?

//cc @fortasse


Seems like people have wanted it for years: https://www.mediawiki.org/wiki/Manual_talk:Collapsible_elements

We could hack something up in javascript though, all the expandable elements share a class we can iterate through.


Yes, if not too much gymnastics, that would be awesome!


I have the JS:


for expanding and


for collapsing. I’m having trouble figuring out how to get the hooks in Mediawiki proper. I think we did something to do the “simple/complicated” documentation split, do you have any idea how the technical side of that @Patrick?


Nevermind. I got Widgets and Templates confused.

Proof of concept here: https://www.whonix.org/w/index.php?title=Fortasse:Sandbox&stable=0
Widget here: https://www.whonix.org/wiki/Widget:Expand_or_Collapse_All

I’m not very stylish, so if you have ideas on how to “prettify” it, by all means. :slight_smile:


Do we need a collapse all button? Seems rather playful. I mean, if someone ever needs that, we could just say “just reload the page”. For perfection’s sake it would be one button, but even that is not really needed. I am more than happy about the “expand all” button. Could you add it to https://www.whonix.org/wiki/Documentation please? I am fine with the styling, but if anyone has suggestions (and code?) to prettify it, why not.


Although when you “expand all” the page is huge. So if a user wants to easily navigate back to another major section, it is easier for them to hit “collapse all” for convenience.

Also, the standard web pages where you see functionality seem to have both. Better to follow normal standards (?)

Either way, thanks @fortasse! It’s a big improvement.


Now live on https://www.whonix.org/wiki/Documentation . The widget should be reusable for any other pages that have mediawiki-style expandable sections, if needed.