Add a "Spoiler!" button around textual content


This macro adds a "Spoiler!" button around designated textual content on the wiki page so that it is hidden from view until you hit the button. It replicates this approach with some cleanups to make it work better as a Trac macro. You can show or hide a particular spoiler by clicking on it. A button to show and hide all the spoilers is also injected into the page.

This is a [[Spoiler([wiki:WikiStart spoiler!])]].


This is a much bigger bit of spoiler info with [wiki:StartPage wiki markup]

And it's a lot more complicated



You can see a video of this in action as well.

See also:

Bugs/Feature Requests

Existing bugs and feature requests for SpoilerMacro are here.

If you have any issues, create a new ticket.


1 / 1


1 / 1


Download the zipped source from here.


You can check out SpoilerMacro from here using Subversion, or browse the source with Trac.


Install this plugin as follows:

pip install svn+

Recent Changes

16348 by rjollos on 2017-03-18 14:56:41
0.7: Conform to PEP8 and remove unused imports

The macro has been tested with Trac 1.2.

16326 by netjunki on 2017-03-13 01:49:42
cleaned up the insertion logic for the reveal all/hide all buttons; add them to the top and bottom of the page
13967 by rjollos on 2014-06-12 19:38:35
Added Fixes #11822.

Thanks to g1itch for reporting.



Author: netjunki
Maintainer: Benjamin Lau

Last modified 2 years ago Last modified on Feb 12, 2022, 4:08:10 PM