<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://elite.mistflux.co.uk/w/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://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Template%3ADemo%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Template:Demo/doc&amp;action=history"/>
	<updated>2026-11-01T00:30:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://elite.mistflux.co.uk/w/index.php?title=Template:Demo/doc&amp;diff=111652&amp;oldid=prev</id>
		<title>Wikipedia&gt;W.andrea: /* */ +links</title>
		<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Template:Demo/doc&amp;diff=111652&amp;oldid=prev"/>
		<updated>2026-06-28T18:23:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;: &lt;/span&gt; +links&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;
&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;
{{Template redirect|Template Pre|Doc pre}}&lt;br /&gt;
{{Template shortcut|tpre}}&lt;br /&gt;
{{Lua|Module:Demo}}&lt;br /&gt;
&lt;br /&gt;
This template simply places template code (or any other code) in a {{xtag|syntaxhighlight|p|params=lang=&amp;quot;[[Help:wikitext|wikitext]]&amp;quot;}} tag and then places the rendering of that code below it.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
The template&amp;#039;s skeleton is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{demo|&amp;lt;nowiki&amp;gt;{{your template}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=floatright&amp;gt;{{Escape template list}}&amp;lt;/div&amp;gt;&lt;br /&gt;
{{warning|Use [[Template:Escape template list|escape templates]] (see the table on the right) to replace code so it is not parsed in the preprocessor or pre-save transform. Alternatively, wrap {{tag|nowiki}} tags around the code (or use {{t|escape}}, which has a demo-escape example).}}&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.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot; inline&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; inline&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;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|Article stub box}}), 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;{{Article stub box&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;
}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Module ===&lt;br /&gt;
If the template used is based on [[Lua]], args can be passed 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;
== TemplateData ==&lt;br /&gt;
{{TemplateData header}}&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;
			&amp;quot;example&amp;quot;: &amp;quot;&amp;lt;nowiki&amp;gt;{{citation needed}}&amp;lt;/nowiki&amp;gt;&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;sep&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Wikitext to fill in as the linebreak&amp;quot;,&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Separator&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;produces:&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&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;
			&amp;quot;label&amp;quot;: &amp;quot;No categories&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Prevent categories from showing up in the output&amp;quot;&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;
			&amp;quot;description&amp;quot;: &amp;quot;CSS styling for the code&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;margin-left: 1.6em;&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;reverse&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Reverse order&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Show the code snippet and the result in reverse order&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;boolean&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
			&amp;quot;autovalue&amp;quot;: &amp;quot;1&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;br&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Number of line breaks&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;Produce this number of line breaks.&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: &amp;quot;1&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;description&amp;quot;: &amp;quot;This template takes wikitext and displays it in syntax highlighting and displays the rendering of the wikitext below.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&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 formatting templates]]&lt;br /&gt;
[[Category:Wikitext processing templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;W.andrea</name></author>
	</entry>
</feed>