Help:Editing: Difference between revisions

ArrowHead294 (talk | contribs)
ArrowHead294 (talk | contribs)
m Syntax highlighting: New section
Line 77: Line 77:
</pre>
</pre>


It is also possible to use Wiki markup within a <code><<nowiki />pre></code> tag, and have it actually be interpreted as markup instead of being escaped. This can be done using a self-closing <code>includeonly</code> tag (<code><<nowiki />includeonly /></code>), or (as seen on Wikipedia and many other sites) with <code>&lt;includeonly&gt;&lt;/includeonly&gt;</code>, as follows:
It is also possible to use Wiki markup within <code><<nowiki />pre></code> tags, and have it actually be interpreted as markup instead of being escaped. This can be done by inserting <code><<nowiki />includeonly /></code> in the opening tag, or (as seen on Wikipedia and many other sites) with <code>&lt;includeonly&gt;&lt;/includeonly&gt;</code>, as follows:


<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
Line 94: Line 94:
[[Wiki]] markup &amp; '''bold''' ''italic'' text
[[Wiki]] markup &amp; '''bold''' ''italic'' text
</pre>
</pre>
=== Syntax highlighting ===
[[mw:extension:SyntaxHighlight|Syntax highlighting]] is a feature to display source code in different colors and fonts to indicate the structure to readers. Wrap the desired code between <code><<nowiki />syntaxhighlight></code> tags and input the desired programming language using the <code>lang</code> parameter in the opening tag. For example:
{{#tag: syntaxhighlight
|{{^(}}syntaxhighlight lang="wikitext"{{)^}}
<!-- Comment -->
[[Wiki]] markup &amp; '''bold''' ''italic'' text
{{^(}}/syntaxhighlight{{)^}}
|lang = wikitext
}}
gives
<syntaxhighlight lang="wikitext">
<!-- Comment -->
[[Wiki]] markup &amp; '''bold''' ''italic'' text
</syntaxhighlight>


=== Lists ===
=== Lists ===