ထာမ်ပလိက်:code
မံက်ပြာကတ်
code
- ပွမဗက်လိက်စၟတ်သမ္တီမချူလဝ်နကဵုခၞံဗဒှ်အပ္ဍဲ ထာမ်ပလိက်:code/documentation ။ [edit]
- လေန်မရပ်စပ်သုၚ်စောဲ: စရၚ်မုက်လိက်ဂၠေံဂၠေံ • လေန်ဂမၠိုၚ် • မပြံၚ်လှာဲဂၠံၚ်ဍာဲဂမၠိုၚ် • ပရေၚ်မပံၚ်စပ်ဂမၠိုၚ် • မဗၠေတ်ဗၠေၚ်ဂမၠိုၚ် (မပါ်ပ္တိတ်တၞဟ်ခြာပိုဒ်/မဝ်ဂျူ) • ကဠာသံၚ်ဗ္တဳ
This is a convenience template, which formats a short inline snippet of code with syntax highlighting of a given language. The language is specified in |1=
(the first positional parameter), while |2=
(the second positional parameter) is the snippet to format. If the snippet contains an equal sign, precede it with =
.
Typical values for |1=
:
text
or omitted: Raw text. This simply applies a monospaced font, similarly to surrounding the snipped with<code>...</code>
.lua
: Lua code.js
orjavascript
: JavaScript code.py
orpython
: Python code.
The possible values are those understood by the <syntaxhighlight>
tag.
It is similar to Wikipedia's w:en:Template:code, but the argument order is opposite.
Example
[ပလေဝ်ဒါန်]{{code||foo("bar")}}
renders asfoo("bar")
.{{code|js|=(65535).toString(16) === 'ffff'}}
renders as(65535).toString(16) === 'ffff'
.
See also
[ပလေဝ်ဒါန်]{{temp}}
{{kbd}}
{{lua}}
{{syntaxhighlight}}