ic – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Handy and neat. May need tweaking.)
 
m (Some wiki formatting)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<code<includeonly></includeonly> style="display:inline;margin:0px;padding:3px 3px 2px 4px;white-space:pre-wrap;">{{{1|No code added!}}}</code><noinclude>
<includeonly><code style="display: inline">{{{1|{{{code|-No code provided-{{TemplateCase||[[Category:ic template usage error]]}}}}}}}}</code></includeonly><noinclude>{{Doc/Template
==Usage==
|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.
This {{Inline code|<nowiki>{{Inline code|_foo {{=}} true;}}</nowiki>}} produces {{Inline code|_foo {{=}} true;}} which is handy.
|param1= code
 
|descr1= the code to display.<br>If it contains an equal sign {{hl|c= =}}:
[[Category:{{uc:{{PAGENAME}}}}]]
** replace it with {{hl|c= <nowiki>{{=}}</nowiki>}}
</noinclude>
** use {{hl|c= code=}} (see example 4)
** use the MediaWiki trick {{hl|c= 1=}} (see example 5)
|example1= <nowiki>{{ic}}</nowiki>
|result1= {{ic}}
|example2= <nowiki>{{ic|[[player]] [[setDamage]] 1;}}</nowiki>
|result2= {{ic|[[player]] [[setDamage]] 1;}}
|example3= <nowiki>{{ic|_fog {{=}} [[fog]];}}</nowiki>
|result3= {{ic|_fog {{=}} [[fog]];}}
|example4= <nowiki>{{ic|code= _fog = [[fog]];}}</nowiki>
|result4= {{ic|code= _fog = [[fog]];}}
|example5= <nowiki>{{ic|1= _fog = [[fog]];}}</nowiki>
|result5= {{ic|1= _fog = [[fog]];}}
|historical= y
}}</noinclude>

Latest revision as of 19:55, 7 April 2024

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;