Template:Var
{{{1}}}
Usage
[सम्पादन]This template is to help facilitate the displaying of variable names (in mathematics, computer source code, etc.) with the semantically correct <var>...</var>
, which also renders the variable in italics, as is customary. This method is preferred to simply italicizing, for accessibility, content/presentation separation, semantic Web, and metadata reasons; [X]HTML's <var>
element has semantic meaning, while simple italicization does not. "Variable" in this sense may include arbitrary or unknown names or terms, example human input, arithmetical variables in equations, etc. This template (and the underlying XHTML) are generally not used if MediaWiki's <math>...</math>
(or any other stand-alone mathematical markup) are being used.
Example:
{{var|username}}
outputs
<var>username</var>
which renders as:
- username
compare to simple ''username''
italicization:
- username
When used alone as variables, the letters "I" (upper-case "i") and "l" (lower-case "L") should be rendered with {{varserif}}
instead of {{var}}, to make them more distinguishable: Template:Varserif, Template:Varserif.
More examples:
- {{kbd|1=ssh {{var|hostname}}}} with {{samp|%}}: "At the Template:Samp prompt, the user must enter Template:Kbd."
- Inside
<code>...</code>
and {{kbd}}: "The commandline should read:% Template:Kbd
(where hostname is the IP address or domain name of the system to connect to); if this is correct, press ↵ Enter."
Some of these examples may look slightly different outside this documentation, because the default background color varies by page type (articles are stark white, template documentation pale green, most other pages very pale grey). In-article example:
- {{kbd|1=ssh {{var|hostname}}}} with {{samp|%}}: "At the Template:Samp prompt, the user must enter Template:Kbd."
- Inside
<code>...</code>
and {{kbd}}: "The commandline should read:% Template:Kbd
(where hostname is the IP address or domain name of the system to connect to); if this is correct, press ↵ Enter."
See also
[सम्पादन]The above documentation is transcluded from Template:Var/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |