Jump to content

Template:Example: Difference between revisions

From The Petit Planet Wiki
No edit summary
Added no_copy parameter
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><nowiki/>
<includeonly><nowiki />
<p style="font-weight:bold;">Wikitext</p>
{{#tag:syntaxhighlight
{{#tag:syntaxhighlight
|{{#invoke:example|unescape|{{{1|}}}}}
|{{#invoke:example|unescape|{{{1|}}}}}
|lang="wikitext"
|lang="wikitext"
|copy=
|{{#if:{{{no_copy|}}}||copy}}=
}}
}}
{{#if:{{{no_result|}}}||;Result
{{#if:{{{no_result|}}}||{{#invoke:example|preprocess|{{{1|}}}}}}}</includeonly><noinclude>{{Documentation|type=Documentation}}</noinclude>
{{#invoke:example|preprocess|{{{1|}}}}}}}</includeonly><noinclude>{{Documentation|type=Documentation}}</noinclude>

Latest revision as of 11:33, 4 May 2026

Template documentation
Note: parts of or the entire template might not be visible without values provided.
This template uses Module:Example, a script written in Lua.

Template that formats the input wikitext and the output from the parser when given some wikitext.

See: Template:Example for the full documentation.

Syntax

[edit source]
{{Example|<nowiki>

</nowiki>}}

This template has 1 unnamed parameter:

  • 1 – Input wikitext.
    • Note: Must be wrapped between <nowiki></nowiki>.
  • no_copy – Set to 1 to remove the copy button.
  • no_result – Set to 1 to hide the results.

Example

[edit source]
{{Example|<nowiki>
{{Navbox
|title = Items
|striped = even
|editlinks = off
|above = Some items are restricted to specific classes; see Classes for more information.
|below = Update 1.2
|below_class = align-right

|group1 = Consumables
|list1 =
* Health Potion
* Mana Potion

|group2 = Weapons
|group2.1 = Swords
|list2.1 =
* Wooden Sword
* Rusted Sword
* Steel Sword
|group2.2 = Bows
|list2.2 =
* Shortbow
* Crossbow
* Longbow
}}
</nowiki>}}

The above wikitext will be rendered as:

{{Navbox
|title = Items
|striped = even
|editlinks = off
|above = Some items are restricted to specific classes; see Classes for more information.
|below = Update 1.2
|below_class = align-right

|group1 = Consumables
|list1 =
* Health Potion
* Mana Potion

|group2 = Weapons
|group2.1 = Swords
|list2.1 =
* Wooden Sword
* Rusted Sword
* Steel Sword
|group2.2 = Bows
|list2.2 =
* Shortbow
* Crossbow
* Longbow
}}

Template Data

[edit source]

Template that formats the input wikitext and the output from the parser when given some wikitext.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Wikitext1

Input wikitext.

Contentrequired
No copyno_copy

Set to 1 to remove the copy button.

Example
1
Booleanoptional
No resultno_result

Set to 1 to hide the results.

Booleanoptional