<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://knasmusic.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ACode%2Fdoc</id>
	<title>Template:Code/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://knasmusic.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ACode%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://knasmusic.com/wiki/index.php?title=Template:Code/doc&amp;action=history"/>
	<updated>2026-04-15T15:08:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://knasmusic.com/wiki/index.php?title=Template:Code/doc&amp;diff=1339&amp;oldid=prev</id>
		<title>Knaadmin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://knasmusic.com/wiki/index.php?title=Template:Code/doc&amp;diff=1339&amp;oldid=prev"/>
		<updated>2025-01-20T18:07:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:07, 20 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Knaadmin</name></author>
	</entry>
	<entry>
		<id>http://knasmusic.com/wiki/index.php?title=Template:Code/doc&amp;diff=1338&amp;oldid=prev</id>
		<title>wikipedia&gt;Jonesey95: rm completely unused id parameter to avoid duplicate blank ids on pages with multiple transclusions</title>
		<link rel="alternate" type="text/html" href="http://knasmusic.com/wiki/index.php?title=Template:Code/doc&amp;diff=1338&amp;oldid=prev"/>
		<updated>2024-09-26T19:49:44Z</updated>

		<summary type="html">&lt;p&gt;rm completely unused id parameter to avoid duplicate blank ids on pages with multiple transclusions&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;!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --&amp;gt;&lt;br /&gt;
{{#ifeq: {{PAGENAME}}|{{ROOTPAGENAME}}|{{High-risk|24,000+}}}}&lt;br /&gt;
{{Expensive}}&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Wraps a short span of text in &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tags (see [[mw:Extension:SyntaxHighlight]]). This template should be used for short samples; longer content should use {{tag|pre}} or {{tag|syntaxhighlight}}. See [[Help:Wiki markup]] for an explanation of what the various tags do.&lt;br /&gt;
&lt;br /&gt;
If the content includes an equals sign (=), you must specify the parameter explicitly: {{tji|code|2=1:int i = 0;}}.&lt;br /&gt;
&lt;br /&gt;
The template uses the {{tag|syntaxhighlight|o}} tag with the attribute &amp;lt;code&amp;gt;inline=1&amp;lt;/code&amp;gt;. This works like the combination of the {{tag|code|o}} and {{tag|nowiki|o}} tags,  applied to the expanded wikitext. For example, {{tji|code|&amp;lt;nowiki&amp;gt;some &amp;#039;&amp;#039;&amp;#039;wiki&amp;#039;&amp;#039;&amp;#039; text&amp;lt;/nowiki&amp;gt;}} will &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; render the word &amp;quot;wiki&amp;quot; in bold, and will render the tripled-single-quotes:&lt;br /&gt;
&lt;br /&gt;
:{{code|some &amp;#039;&amp;#039;&amp;#039;wiki&amp;#039;&amp;#039;&amp;#039; text}}&lt;br /&gt;
&lt;br /&gt;
If the above example is declared as wikitext (via {{tji|code|&amp;lt;nowiki&amp;gt;some &amp;#039;&amp;#039;&amp;#039;wiki&amp;#039;&amp;#039;&amp;#039; text&amp;lt;/nowiki&amp;gt;|lang:wikitext}}, the output is rendered as follows:&lt;br /&gt;
&lt;br /&gt;
:{{code|some &amp;#039;&amp;#039;&amp;#039;wiki&amp;#039;&amp;#039;&amp;#039; text|lang=wikitext}}&lt;br /&gt;
&lt;br /&gt;
However, {{tji|code|&amp;lt;nowiki&amp;gt;a {{template}} call&amp;lt;/nowiki&amp;gt;|lang:wikitext}} will still invoke the template:&lt;br /&gt;
&lt;br /&gt;
:{{code|a {{template}} call|lang=wikitext}}&lt;br /&gt;
&lt;br /&gt;
Use {{tag|nowiki}} around the template name to avoid this problem:&lt;br /&gt;
&lt;br /&gt;
:{{code|a &amp;lt;nowiki&amp;gt;{{template}}&amp;lt;/nowiki&amp;gt; call|lang=wikitext}}&lt;br /&gt;
&lt;br /&gt;
When used inline with regular text, {{tnull|code}} generally looks best and is easiest to read when it is explicitly spaced apart from the regular text:&lt;br /&gt;
:{{code|foo &amp;amp;nbsp;&amp;lt;nowiki&amp;gt;{{code|bar baz}}&amp;lt;/nowiki&amp;gt;&amp;amp;nbsp; quux.|lang=wikitext}}&lt;br /&gt;
is well spaced:&lt;br /&gt;
:foo &amp;amp;nbsp;{{code|bar baz}}&amp;amp;nbsp; quux.&lt;br /&gt;
versus:&lt;br /&gt;
:{{code|foo &amp;lt;nowiki&amp;gt;{{code|bar baz}}&amp;lt;/nowiki&amp;gt; quux.|wikitext}}&lt;br /&gt;
which is less visually clear:&lt;br /&gt;
:foo {{code|bar baz}} quux.&lt;br /&gt;
because &amp;quot;foo&amp;quot; and &amp;quot;{{code|bar}}&amp;quot; will seem more closely associated than &amp;quot;{{code|bar}}&amp;quot; and &amp;quot;{{code|baz}}&amp;quot;; the width of the space character in a monospaced font is almost always larger than in a proportional font.&lt;br /&gt;
&lt;br /&gt;
Use parameter {{{2}}} (unnamed, as {{para|2}}, or more explicitly as {{para|lang}}) to specify a language for [[mw:Extension:SyntaxHighlight]]. This option defaults to {{para|lang|text}}, i.e. no highlighting. Valid values include {{para|lang|wikitext}} for wikitext, {{para|lang|html}} for HTML, along with many other languages including {{code|php}}, {{code|perl}}, {{code|css}}, {{code|javascript}}, {{code|mysql}}. Attempting to use an invalid value for lang will cause the page to be added to [[:Category:Pages with syntax highlighting errors]], and no syntax highlighting will be present in the output. {{code|html4strict}} and {{code|html5}} used to be valid values - however, {{para|lang|html}} should be used instead.&lt;br /&gt;
&lt;br /&gt;
This template does not need to be [[Wikipedia:Template substitution|substituted]].&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
{{markup&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;Lorem {{code|ipsum &amp;#039;&amp;#039;&amp;#039;dolor&amp;#039;&amp;#039;&amp;#039;}} sit amet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|Lorem {{code|ipsum &amp;#039;&amp;#039;&amp;#039;dolor&amp;#039;&amp;#039;&amp;#039;}} sit amet&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;Lorem {{code|ipsum &amp;#039;&amp;#039;&amp;#039;dolor&amp;#039;&amp;#039;&amp;#039;|wikitext}} sit amet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|Lorem {{code|ipsum &amp;#039;&amp;#039;&amp;#039;dolor&amp;#039;&amp;#039;&amp;#039;|wikitext}} sit amet&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;The declaration {{code|lang=cpp |int foo(const std::string&amp;amp; bar, const std::vector&amp;lt;long double*&amp;gt;&amp;amp; baz);}} is the prototype for a function defined later.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|The declaration {{code|lang=cpp |int foo(const std::string&amp;amp; bar, const std::vector&amp;lt;long double*&amp;gt;&amp;amp; baz);}} is the prototype for a function defined later.&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;If the code contains an [[equals sign]], such as {{code |lang=javascript |code=var img = document.getElementsByTagName(&amp;quot;img&amp;quot;);}}, you must identify the first parameter explicitly as {{{1}}} or {{{code}}}; see also [[:bugzilla:5138]].&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|If the code contains an [[equals sign]], such as {{code |lang=javascript |code=var img = document.getElementsByTagName(&amp;quot;img&amp;quot;);}}, you must identify the first parameter explicitly as {{{1}}} or {{{code}}}; see also [[:bugzilla:5138]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Included templates===&lt;br /&gt;
Embedded templates do not function as expected inside {{tl|code}}; for longer, free-form blocks of code, which can contain templates such as {{tl|var}} and {{tl|samp}}, use {{tag|code}} as a wrapper instead of this template.&lt;br /&gt;
&lt;br /&gt;
Templates used inside {{tl|code}} expose the rendered HTML— this can be useful. For example:&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
{{markup&lt;br /&gt;
|1=&amp;lt;nowiki&amp;gt;{{code|&lt;br /&gt;
{{cite web |title=Title |url=http://example.org}}&lt;br /&gt;
|lang=html&lt;br /&gt;
}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|2={{code|&lt;br /&gt;
{{cite web |title=Title |url=http://example.org}}&lt;br /&gt;
|lang=html&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The above example shows the HTML rendered by the citation template, including the hidden metadata.&lt;br /&gt;
&lt;br /&gt;
== Expensive Parser Function warning ==&lt;br /&gt;
This template internally uses [[mw:Extension:SyntaxHighlight]], which is considered an &amp;#039;expensive parser function&amp;#039; (see [[WP:EXPENSIVE]]). If used on a page which uses more than 500 expensive parser functions, the output of subsequent uses of this template will be presented using {{tag|code}} formatting (without any syntax highlighting) instead.&lt;br /&gt;
&lt;br /&gt;
== TemplateData ==&lt;br /&gt;
{{Format TemplateData|&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;description&amp;quot;: &amp;quot;An inline source code string.&amp;quot;,&lt;br /&gt;
	&amp;quot;format&amp;quot;: &amp;quot;inline&amp;quot;,&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;Code&amp;quot;,&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&amp;quot;code&amp;quot;],&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The code to display.&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;2&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Language&amp;quot;,&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&amp;quot;lang&amp;quot;],&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The programming language of the source code. List of valid values is at: [[mw:Extension:SyntaxHighlight#Supported_languages]]&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
			&amp;quot;suggested&amp;quot;: true,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;class&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Class&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;style&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;CSS Style&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|PreCode}}, which forbids line breaks inside the code&lt;br /&gt;
* {{tl|codett}}, wrapper for this template that removes background and border styling&lt;br /&gt;
* {{tl|mono}}, monospaced font only&lt;br /&gt;
* {{tl|param value}}, monospaced; friendly handling for blank space&lt;br /&gt;
* {{tl|Syntaxhighlight}}&lt;br /&gt;
* {{tl|kbd}}, for keyboard input&lt;br /&gt;
* [[Help:Wiki markup]]&lt;br /&gt;
&lt;br /&gt;
{{Semantic markup templates|show}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Programming typing-aid templates]]&lt;br /&gt;
[[Category:Semantic markup templates]]&lt;br /&gt;
[[Category:Wikipedia XHTML tag-replacing templates]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Jonesey95</name></author>
	</entry>
</feed>