ic – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add CSS usage)
m (Text replacement - "<tt>([^ ]+)<\/tt>" to "{{hl|c= $1}}")
Line 2: Line 2:
|descr= This template displays '''i'''nline '''c'''ode. It also adds the page to the [[:Category:ic template usage error|ic template usage error]] category on usage error.
|descr= This template displays '''i'''nline '''c'''ode. It also adds the page to the [[:Category:ic template usage error|ic template usage error]] category on usage error.
|param1= code
|param1= code
|descr1= the code to display.<br>If it contains an equal sign <tt>=</tt>:
|descr1= the code to display.<br>If it contains an equal sign {{hl|c= =}}:
** replace it with <tt><nowiki>{{=}}</nowiki></tt>
** replace it with {{hl|c= <nowiki>{{=}}</nowiki>}}
** use <tt>code=</tt> (see example 4)
** use {{hl|c= code=}} (see example 4)
** use the MediaWiki trick <tt>1=</tt> (see example 5)
** use the MediaWiki trick {{hl|c= 1=}} (see example 5)
|example1= <nowiki>{{ic}}</nowiki>
|example1= <nowiki>{{ic}}</nowiki>
|result1= {{ic}}
|result1= {{ic}}

Revision as of 10:34, 16 November 2021

This template displays inline code. It also adds the page to the ic template usage error category on usage error.

This template is used on these pages.

Usage

{{ic|code}}

  • code: the code to display.
    If it contains an equal sign =:
    • replace it with {{=}}
    • use code= (see example 4)
    • use the MediaWiki trick 1= (see example 5)
Examples
Code Result
{{ic}} -No code provided-
{{ic|[[player]] [[setDamage]] 1;}} player setDamage 1;
{{ic|_fog {{=}} [[fog]];}} _fog = fog;
{{ic|code= _fog = [[fog]];}} _fog = fog;
{{ic|1= _fog = [[fog]];}} _fog = fog;