Шаблон:Var/doc: различия между версиями
Andras (обсуждение | вклад) Нет описания правки |
Andras (обсуждение | вклад) Нет описания правки |
||
| (не показаны 3 промежуточные версии этого же участника) | |||
| Строка 1: | Строка 1: | ||
{{Docpage}} | {{Docpage}} | ||
{{ | {{Закончить перевод|En}} | ||
Шаблон {{T|Var}} используют для отображения имён ''переменных'' (в математике, в исходном коде компьютера, в документации шаблонов и т. д.) с [[Семантическая вёрстка|семантически корректным]] кодом, помещая этот код в контейнер {{Tag|var}}, который [[браузер]]ы, как правило, выделяют курсивным начертанием. Этот метод из соображения семантичности является более предпочтительным, чем простое выделение текста курсивом. | Шаблон {{T|Var}} используют для отображения имён ''переменных'' (в математике, в исходном коде компьютера, в документации шаблонов и т. д.) с [[Семантическая вёрстка|семантически корректным]] кодом, помещая этот код в контейнер {{Tag|var}}, который [[браузер]]ы, как правило, выделяют курсивным начертанием. Этот метод из соображения семантичности является более предпочтительным, чем простое выделение текста курсивом. | ||
| Строка 11: | Строка 11: | ||
; Примеры: | ; Примеры: | ||
: {{ | : {{Tcl|Var|username}} | ||
выводит следующий HTML: | выводит следующий HTML: | ||
: '''{{Tag|var|content=username}}''' который отображается, как: {{Var|username}} | : '''{{Tag|var|content=username}}''' который отображается, как: {{Var|username}} | ||
| Строка 17: | Строка 17: | ||
Note that on the screen or in print, this renders as simple italicization, as does {{Code|<nowiki>''username''</nowiki>}} (using pairs of apostrophes) or {{Tag|i|content=username}} (using HTML), yet it carries more semantic meaning than either of these methods. | Note that on the screen or in print, this renders as simple italicization, as does {{Code|<nowiki>''username''</nowiki>}} (using pairs of apostrophes) or {{Tag|i|content=username}} (using HTML), yet it carries more semantic meaning than either of these methods. | ||
At times, you may wish to use a serif font. This is especially true when attempting to render single-letter variables like «I» (upper-case «i») and «l» (lower-case «L»), since they are nearly indistinguishable (if at all). In such situations, use the {{Tcl|Varserif}} template instead of {{ | At times, you may wish to use a serif font. This is especially true when attempting to render single-letter variables like «I» (upper-case «i») and «l» (lower-case «L»), since they are nearly indistinguishable (if at all). In such situations, use the {{Tcl|Varserif}} template instead of {{Tc|Var}}, to make them more distinguishable, like these serif examples: {{Varserif|I}}, {{Varserif|l}}. | ||
'''More examples''': | '''More examples''': | ||
| Строка 25: | Строка 25: | ||
: <code>{{Tag|Var|content=username}}</code> → {{Var|Username}} | : <code>{{Tag|Var|content=username}}</code> → {{Var|Username}} | ||
<nowiki>The commandline should read: {{Samp|%}} {{Kbd|1=ssh {{Var|Hostname}}}}<br />(where {{Var|Hostname}} is the IP address or ...)<br />If it is correct, press {{ | <nowiki>The commandline should read: {{Samp|%}} {{Kbd|1=ssh {{Var|Hostname}}}}<br />(where {{Var|Hostname}} is the IP address or ...)<br />If it is correct, press {{Клавиша|Enter}}.</nowiki> | ||
The commandline should read: {{Samp|%}} {{Kbd|1=ssh {{Var|Hostname}}}}<br />(where {{Var|Hostname}} is the IP address or ...)<br />If it is correct, press {{ | The commandline should read: {{Samp|%}} {{Kbd|1=ssh {{Var|Hostname}}}}<br />(where {{Var|Hostname}} is the IP address or ...)<br />If it is correct, press {{Клавиша|Enter}}. | ||
<nowiki>in this equation, let {{Var|x}}{{=}}1 and {{Var|y}}{{=}}120 ...</nowiki> | <nowiki>in this equation, let {{Var|x}}{{=}}1 and {{Var|y}}{{=}}120 ...</nowiki> | ||
Текущая версия от 12:53, 19 мая 2023
Ошибка Lua в Модуль:Message_box на строке 113: attempt to index field 'cfg' (a nil value).
Шаблон {{Var}} используют для отображения имён переменных (в математике, в исходном коде компьютера, в документации шаблонов и т. д.) с семантически корректным кодом, помещая этот код в контейнер <var></var>, который браузеры, как правило, выделяют курсивным начертанием. Этот метод из соображения семантичности является более предпочтительным, чем простое выделение текста курсивом.
Переменная в этом смысле может включать в себя произвольные или неизвестные имена или термины, арифметические переменные в уравнениях, и т. д. Этот шаблон в XHTML, не используется, если в MediaWiki <math></math> применяются теги (или любая другая автономная математическая разметка).
- Формат:
{{Var|текст}}
Not
- Примеры
{{Var|username}}
выводит следующий HTML:
<var>username</var>который отображается, как: username
Note that on the screen or in print, this renders as simple italicization, as does ''username'' (using pairs of apostrophes) or <i>username</i> (using HTML), yet it carries more semantic meaning than either of these methods.
At times, you may wish to use a serif font. This is especially true when attempting to render single-letter variables like «I» (upper-case «i») and «l» (lower-case «L»), since they are nearly indistinguishable (if at all). In such situations, use the {{Varserif}} template instead of {{Var}}, to make them more distinguishable, like these serif examples: Шаблон:Varserif, Шаблон:Varserif.
More examples:
The HTML code: <code>{{Tag|Var|content=username}}</code> → {{Var|Username}} The HTML code:
→ Username<Var>username</Var>
The commandline should read: {{Samp|%}} {{Kbd|1=ssh {{Var|Hostname}}}}<br />(where {{Var|Hostname}} is the IP address or ...)<br />If it is correct, press {{Клавиша|Enter}}.
The commandline should read: % ssh Hostname
(where Hostname is the IP address or ...)
If it is correct, press ↵ Enter.
in this equation, let {{Var|x}}{{=}}1 and {{Var|y}}{{=}}120 ... in this equation, let x=1 and y=120 ...
{{Para|Accessdate|{{Var|Todays_date}}}}