<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://funkinchan.fun/index.php?action=history&amp;feed=atom&amp;title=Template%3ADemo%2Fdoc</id>
	<title>Template:Demo/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://funkinchan.fun/index.php?action=history&amp;feed=atom&amp;title=Template%3ADemo%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://funkinchan.fun/index.php?title=Template:Demo/doc&amp;action=history"/>
	<updated>2026-10-18T21:02:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://funkinchan.fun/index.php?title=Template:Demo/doc&amp;diff=300&amp;oldid=prev</id>
		<title>Jedevari: making template</title>
		<link rel="alternate" type="text/html" href="https://funkinchan.fun/index.php?title=Template:Demo/doc&amp;diff=300&amp;oldid=prev"/>
		<updated>2023-09-20T03:18:57Z</updated>

		<summary type="html">&lt;p&gt;making template&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{Lua|Module:Demo}}&lt;br /&gt;
{{Template redirect|Template Pre|Doc pre}}&lt;br /&gt;
{{Template shortcut|tpre}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
This template simply places template code (or any other code) in a {{tag|syntaxhighlight|params=lang=&amp;quot;wikitext&amp;quot;}} tag and then places the template below the code.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{demo&lt;br /&gt;
|sep =&lt;br /&gt;
|nocat =&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;{{your template}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;{{red|IMPORTANT:}}&amp;#039;&amp;#039;&amp;#039; You must wrap include {{tag|nowiki}} tags around the source to be demonstrated (or use {{t|escape}}, which has a demo-escape example), like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot; inline&amp;gt;{{demo|&amp;amp;lt;nowiki&amp;gt;[template source]&amp;lt;/nowiki&amp;gt;}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failure to wrap {{tag|nowiki}} tags around the source may cause the source to be executed before it reaches this template: &amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{demo|{{fail}}}}&amp;lt;/syntaxhighlight&amp;gt; produces&lt;br /&gt;
{{demo|{{fail}}}}&lt;br /&gt;
&lt;br /&gt;
=== Pre style ===&lt;br /&gt;
Set {{para|style}} to add any CSS text to the {{tag|pre}} tag.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{demo|style=margin-left: 1.6em;|&amp;lt;nowiki&amp;gt;{{done}}&amp;lt;/nowiki&amp;gt;}}&amp;lt;/syntaxhighlight&amp;gt; will produce&lt;br /&gt;
&lt;br /&gt;
{{demo|style=margin-left: 1.6em;|&amp;lt;nowiki&amp;gt;{{done}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Separator ===&lt;br /&gt;
You can change the separator between the {{tag|syntaxhighlight|o}} and the template by setting the {{para|sep}} parameter.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{demo|sep=produces|&amp;amp;lt;nowiki&amp;gt;{{done}}&amp;lt;/nowiki&amp;gt;}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{demo|sep=produces|&amp;lt;nowiki&amp;gt;{{done}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You may use {{para|sep|&amp;amp;lt;td&amp;gt;}} can make the demonstration fit in a table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{{demo|br=&amp;lt;td&amp;gt;|{{((}}done{{))}}}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Instead of using {{para|sep}}, you can also specify the number of line breaks between the code and the template in the {{para|br}} parameter.&lt;br /&gt;
&lt;br /&gt;
=== Reverse order ===&lt;br /&gt;
Use {{para|reverse|1}} to show the code snippet and the result in reverse order:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{demo|reverse=1|&amp;lt;nowiki&amp;gt;{{tl|template}}&amp;lt;/nowiki&amp;gt;}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will produce&lt;br /&gt;
&lt;br /&gt;
{{demo|reverse=1|&amp;lt;nowiki&amp;gt;{{tl|template}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Category removal ===&lt;br /&gt;
For templates that add categories (e.g. {{t|Asbox}}), set {{para|nocat}} (or {{para|demo_kill_categories}}) to anything to prevent them from showing up in the output:&lt;br /&gt;
{{demo|br=produces:|demo_kill_categories=yes&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;{{Asbox&lt;br /&gt;
| image = Østfold_våpen.svg&lt;br /&gt;
| pix = 30&lt;br /&gt;
| subject = [[Østfold]] location&lt;br /&gt;
| name = Template:Østfold-geo-stub&lt;br /&gt;
| category = Østfold geography stubs&lt;br /&gt;
| tempsort = *&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Module ===&lt;br /&gt;
If the template used is based on [[Lua (programming language)|Lua]], you can pass args directly to the demonstrated module by invoking [[Module:Demo]] like so: (this would reduce server stress)&lt;br /&gt;
{{demo|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{{#invoke:Demo|module|demo_module=RoundN|demo_module_func=N2|demo_template=Round2&lt;br /&gt;
|bold_winner=high&lt;br /&gt;
|May 1|Team A|1|Team B|2&lt;br /&gt;
}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Note: It will attempt to preserve line breaks for unnamed params, but such is impossible for named params since those are stripped of whitespace/order before being passed to the module. Also note, you should use {{para|demo_sep}} instead of {{para|sep}} (all args you don&amp;#039;t want being passed should be prefixed with &amp;lt;code&amp;gt;demo_&amp;lt;/code&amp;gt; if not already)&lt;br /&gt;
&lt;br /&gt;
== See also==&lt;br /&gt;
* {{tl|Demo-inline}}, for an inline version of this template&lt;br /&gt;
* {{tl|Escape}} - which has an example of this template without nowiki tags&lt;br /&gt;
* {{tl|Nowiki template demo}} which uses [[Module:Template test case]]&lt;br /&gt;
* {{tl|Automarkup}} which uses [[Module:Automarkup]]&lt;br /&gt;
&lt;br /&gt;
===Other formatting templates===&lt;br /&gt;
{{#lsth:Template:Template-linking_templates|Other formatting templates}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Documentation assistance templates]]&lt;br /&gt;
[[Category:Programming typing-aid templates]]&lt;br /&gt;
[[Category:Template test cases| ]]&lt;br /&gt;
[[Category:Wikipedia utility templates]]&lt;br /&gt;
[[Category:Wikitext processing templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;1&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Content&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;must be wrapped in &amp;lt;nowiki&amp;gt;&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;sep&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Number of line breaks, or wikitext to fill in as the linebreak&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
        &amp;quot;sep&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Number of line breaks, or wikitext to fill in as the linebreak&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;nocat&amp;quot;: {&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;boolean&amp;quot;,&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;demo_kill_categories&amp;quot;&lt;br /&gt;
			]&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;result_arg&amp;quot;: {},&lt;br /&gt;
		&amp;quot;style &amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;&amp;lt;syntaxhighlight&amp;gt; style&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jedevari</name></author>
	</entry>
</feed>