v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Template:Code"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#tag:syntaxhighlight|{{{1|[token]}}}|lang="BBCode"|class="code-raw"|style="border-left: 6px solid #a4a4a4;{{{style|}}}"}}
+
{{#tag:syntaxhighlight|{{{code|{{{1|[token]}}}}}}|lang="BBCode"|class="code-raw"|style="border-left: 6px solid #a4a4a4;{{{style|}}}"}}<noinclude>
 +
 
 +
Wrapper template that show syntax-highlighted text. The template uses the <code><nowiki><syntaxhighlight></nowiki></code> tag (see [https://www.mediawiki.org/wiki/Extension:SyntaxHighlight Extension:SyntaxHighlight]).
 +
 
 +
==Usage==
 +
Simply wrapper the template around your code: {{t|code|<your code here>}} or {{t|code|<nowiki>code=<your code here></nowiki>}}
 +
<pre>
 +
{{{code|
 +
...
 +
Your code
 +
...
 +
}}
 +
</pre>
 +
 
 +
Note: If the content includes an equals sign (=), you must specify the parameter explicitly:
 +
 
 +
<pre>
 +
{{{code|code=
 +
...
 +
Your code with = sign
 +
...
 +
}}
 +
</pre>
 +
 
 +
[[Category:templates]]
 +
</noinclude>

Latest revision as of 16:56, 2 February 2022

[token]

Wrapper template that show syntax-highlighted text. The template uses the <syntaxhighlight> tag (see Extension:SyntaxHighlight).

Usage[edit]

Simply wrapper the template around your code: {{code|<your code here>}} or {{code|code=<your code here>}}

{{{code|
...
Your code
...
}}

Note: If the content includes an equals sign (=), you must specify the parameter explicitly:

{{{code|code=
...
Your code with = sign
...
}}