Help:Editing: Difference between revisions
ArrowHead294 (talk | contribs) m →Tables |
ArrowHead294 (talk | contribs) m →Syntax highlighting: New section |
||
| Line 77: | Line 77: | ||
</pre> | </pre> | ||
It is also possible to use Wiki markup within | 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><includeonly></includeonly></code>, as follows: | ||
<syntaxhighlight lang="wikitext"> | <syntaxhighlight lang="wikitext"> | ||
| Line 94: | Line 94: | ||
[[Wiki]] markup & '''bold''' ''italic'' text | [[Wiki]] markup & '''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 & '''bold''' ''italic'' text | |||
{{^(}}/syntaxhighlight{{)^}} | |||
|lang = wikitext | |||
}} | |||
gives | |||
<syntaxhighlight lang="wikitext"> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</syntaxhighlight> | |||
=== Lists === | === Lists === | ||