Extension:SectionHide

The SectionHide extension adds a [hide] link wherever there is a section heading [edit] link. This link will hide all content between that section header and the next section header of the same level, changing itself to read [show] in the process. Clicking [show] will restore the section to view.

Example
Illustration showing how each hide link conceals the related block in a nested fashion while keeping the title visible.



Mediawiki:Common.js
Add this here, or in individual skins

Versions
Added a hide/show all link at the top
 * Version 1.1

Added an option to keep the content before the first X-1 headings visible when using the hide all link. NB set to 1 to hide everything from the first heading to the end.
 * Version 1.2

'''Caveat - using anything other than 1 means that divs are overlapping instead of nested, which is a standards violation in html/xml. Some browsers deal with it, some don't.''' By the same token, any divs in the actual text that cross over headings will potentially cause a problem.

Author Notes
Several similar extensions were created in the past, but they are not maintained and didn't do quite what I needed.