Template:Spoiler/doc: Difference between revisions

Content added Content deleted
(Created page with "Puts text into a clickable-to-reveal spoiler. ==Usage== <pre> {{spoiler | text = [Optional] Inline spoiler text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.) | label = [Optional] Spoiler label. Default is "Click to reveal" | label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide" | class = [Optional] CSS class to use for styles. Default is "default" }} </...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
<pre>
<pre>
{{spoiler
{{spoiler
| text = [Optional] Inline spoiler text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.)
| text = [Optional] Inline text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.)
| label = [Optional] Spoiler label. Default is "Click to reveal"
| label = [Optional] Spoiler label. Default is "Click to reveal"
| label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide"
| label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide"
Line 14: Line 14:
This is an {{spoiler|text=inline spoiler}}.
This is an {{spoiler|text=inline spoiler}}.


Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, <code>text</code> (what will be revealed on click) and <code>spoilertext</code> (a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a <code>=</code>, for technical reasons), as shown:

<code><nowiki>
{{spoiler}}
{{spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS A BLOCK CONTENT SPOILER.
Line 19: Line 22:
THIS IS MORE CONTENT
THIS IS MORE CONTENT
{{spoiler-end}}
{{spoiler-end}}
</nowiki></code>


gives

{{spoiler}}
THIS IS A BLOCK CONTENT SPOILER.

THIS IS MORE CONTENT
{{spoiler-end}}

<code><nowiki>
{{spoiler|label=This is a multi-nested spoiler}}
{{spoiler|label=This is a multi-nested spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS A BLOCK CONTENT SPOILER.
Line 26: Line 39:
{{spoiler}}
{{spoiler}}
THIS IS A NESTED BLOCK LEVEL SPOILER
THIS IS A NESTED BLOCK LEVEL SPOILER
{{spoiler-end}}

THIS IS A {{spoiler|text=NESTED INLINE SPOILER}}.
{{spoiler-end}}
</nowiki></code>

{{spoiler|label=This is a multi-nested spoiler}}

THIS IS A BLOCK CONTENT SPOILER.

THIS IS MORE CONTENT

{{spoiler}}

THIS IS A NESTED BLOCK LEVEL SPOILER

{{spoiler-end}}
{{spoiler-end}}



Latest revision as of 02:37, 12 September 2022

Puts text into a clickable-to-reveal spoiler.

Usage[edit source]

 {{spoiler
  | text       = [Optional] Inline text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.)
  | label      = [Optional] Spoiler label. Default is "Click to reveal"
  | label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide"
  | class      = [Optional] CSS class to use for styles. Default is "default"
 }}

Examples[edit source]

This is an Click to revealinline spoiler.

Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, text (what will be revealed on click) and spoilertext (a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a =, for technical reasons), as shown:

{{spoiler}} THIS IS A BLOCK CONTENT SPOILER. THIS IS MORE CONTENT {{spoiler-end}}

gives

 

THIS IS A BLOCK CONTENT SPOILER.

THIS IS MORE CONTENT

{{spoiler|label=This is a multi-nested spoiler}} THIS IS A BLOCK CONTENT SPOILER. THIS IS MORE CONTENT {{spoiler}} THIS IS A NESTED BLOCK LEVEL SPOILER {{spoiler-end}} THIS IS A {{spoiler|text=NESTED INLINE SPOILER}}. {{spoiler-end}}

 

THIS IS A BLOCK CONTENT SPOILER.

THIS IS MORE CONTENT

 

THIS IS A NESTED BLOCK LEVEL SPOILER

THIS IS A Click to revealNESTED INLINE SPOILER.