Spoiler Macro

Description

Add a "Spoiler!" button around text content of the macro so that it's hidden from view until you hit the button. This implements a concept that was mentioned on the trac-user mailing list and basically duplicates this approach with some cleanups to make it work better as a 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.

Bugs/Feature Requests

Existing bugs and feature requests for SpoilerMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Or you can install using easy_install:

easy_install http://trac-hacks.org/svn/spoilermacro/0.12

Source

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

Example

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

{{{
#!Spoiler

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

And it's a lot more complicated

||it||even||has||
||a||table||inside||

}}}

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

Recent Changes

[11335] by netjunki on 02/27/12 07:23:43

trying to fix conflict with other JS in other plug-ins

[11334] by netjunki on 02/27/12 01:10:07

0.5 hide/reveal all spoilers using a single click

[11333] by netjunki on 02/27/12 00:52:02

0.4 hide again if you click on spoiler content

[11329] by netjunki on 02/26/12 12:10:30

0.3 improved behavior by using format_to_html and format_to_oneliner to create different versions of the embedded content depending on usage. Thanks to Peter Suter on trac-dev for the necessary logic to accomplish this.

Author/Contributors

Author: netjunki
Maintainer: netjunki
Contributors: