Шаблон:Kbd/doc: различия между версиями

Материал из Народные сказки
Перейти к навигации Перейти к поиску
Нет описания правки
Нет описания правки
Строка 13: Строка 13:
* {{Tc|kbd|71077345}}: «Entering {{Kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''.»
* {{Tc|kbd|71077345}}: «Entering {{Kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}}: «At the {{Samp|%}} prompt, the user must enter {{Kbd|1=ssh {{Var|hostname}}}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}}: «At the {{Samp|%}} prompt, the user must enter {{Kbd|1=ssh {{Var|hostname}}}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}} and {{Tc|key press|Enter}}: «At the {{Samp|%}} prompt, the user must input {{Kbd|1=ssh {{Var|hostname}}}}{{key press|Enter}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}} and {{Tc|key press|Enter}}: «At the {{Samp|%}} prompt, the user must input {{Kbd|1=ssh {{Var|hostname}}}}{{Клавиша|Enter}}.»
* Inside {{Tag|code}}: «The commandline should read: <code>% {{Kbd|1=ssh {{Var|hostname}}}}</code> (where {{Var|hostname}} is the IP address or domain name of the system to connect to); if this is correct, press {{Клавиша|Enter}}.»
* Inside {{Tag|code}}: «The commandline should read: <code>% {{Kbd|1=ssh {{Var|hostname}}}}</code> (where {{Var|hostname}} is the IP address or domain name of the system to connect to); if this is correct, press {{Клавиша|Enter}}.»
* {{Tc|kbd|1{{=}}<nowiki>{{Lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{Kbd|1={{Lorem}}|spacing=0}}
* {{Tc|kbd|1{{=}}<nowiki>{{Lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{Kbd|1={{Lorem}}|spacing=0}}
Строка 23: Строка 23:
* {{Tc|kbd|71077345}}: «Entering {{Kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''.»
* {{Tc|kbd|71077345}}: «Entering {{Kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}}: «At the {{Samp|%}} prompt, the user must enter {{Kbd|1=ssh {{Var|hostname}}}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}}: «At the {{Samp|%}} prompt, the user must enter {{Kbd|1=ssh {{Var|hostname}}}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}} and {{Tc|key press|Enter}}: «At the {{Samp|%}} prompt, the user must input {{Kbd|1=ssh {{Var|hostname}}}}{{key press|Enter}}.»
* {{Tc|kbd|1{{=}}ssh <nowiki>{{Var|hostname}}</nowiki>}} with {{Tc|samp|%}} and {{Tc|key press|Enter}}: «At the {{Samp|%}} prompt, the user must input {{Kbd|1=ssh {{Var|hostname}}}}{{Клавиша|Enter}}.»
* Inside {{Tag|code}}: «The commandline should read: <code>% {{Kbd|1=ssh {{Var|hostname}}}}</code> (where {{Var|Hostname}} is the IP address or domain name of the system to connect to); if this is correct, press {{Клавиша|Enter}}.»
* Inside {{Tag|code}}: «The commandline should read: <code>% {{Kbd|1=ssh {{Var|hostname}}}}</code> (where {{Var|Hostname}} is the IP address or domain name of the system to connect to); if this is correct, press {{Клавиша|Enter}}.»
* {{Tc|Kbd|1{{=}}<nowiki>{{Lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{Kbd|1={{Lorem}}|spacing=0}}
* {{Tc|Kbd|1{{=}}<nowiki>{{Lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{Kbd|1={{Lorem}}|spacing=0}}

Версия от 18:27, 18 мая 2023

Ошибка Lua в Модуль:Message_box на строке 113: attempt to index field 'cfg' (a nil value).

Purpose

This template is for explicitly indicating that the content inside it represents input from a keyboard or other source (speech recognition software, exit code of an application, standard input, etc.) It uses the [X]HTML element <kbd></kbd> (keyboard input) which exists for this purpose, and applies some styling to it, namely a faint grey background (borrowed from the related template Шаблон:tlx) and slight CSS letter-spacing to suggest individually entered characters. It retains the default monospaced (non-proportional) font style of the <kbd> element. Because it uses <kbd></kbd> instead of simply applying visual style effects, it is semantic markup that conveys meaning, and it can be further acted upon by the user agent (e.g. with custom local style sheets). This tag is the exact opposite of Шаблон:tlx, which is for example output.

Usage

The template takes one mandatory parameter, the content to be marked up. If this content contains "=" (an equals sign), the parameter must be explicitly named |1 =, or the template will fail. (This is a limitation of the MediaWiki software, not the template.) It is always safer to use |1 = syntax. It may be used as a container for {[tlx|var}}, Шаблон:tlx or <var></var> when the example keyboard input contains or consists entirely of a variable. It may also be used with (but not inside) Шаблон:tlx, or with <code></code> (it generally should not be used inside the latter, as input is not a part of source code, but something that interacts with it; however, this style can be used to illustrate computer display of mixed type, as illustrated below).

There is an optional parameter | (or | or any other value), to get rid of the slight letter spacing, which can look awkward on long passages of input.

Examples:

  • {{kbd|71077345}}: «Entering 71077345 on a calculator and turning it upside down appears to spell ShellOil
  • {{kbd|1=ssh {{Var|hostname}}}} with {{samp|%}}: «At the % prompt, the user must enter ssh hostname
  • {{kbd|1=ssh {{Var|hostname}}}} with {{samp|%}} and {{key press|Enter}}: «At the % prompt, the user must input ssh hostname↵ Enter
  • Inside <code></code>: «The commandline should read: % ssh hostname (where hostname is the IP address or domain name of the system to connect to); if this is correct, press ↵ Enter
  • {{kbd|1={{Lorem}}|spacing=0}} to get rid of the spacing: Шаблон:Lorem

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|71077345}}: «Entering 71077345 on a calculator and turning it upside down appears to spell ShellOil
  • {{kbd|1=ssh {{Var|hostname}}}} with {{samp|%}}: «At the % prompt, the user must enter ssh hostname
  • {{kbd|1=ssh {{Var|hostname}}}} with {{samp|%}} and {{key press|Enter}}: «At the % prompt, the user must input ssh hostname↵ Enter
  • Inside <code></code>: «The commandline should read: % ssh hostname (where Hostname is the IP address or domain name of the system to connect to); if this is correct, press ↵ Enter
  • {{Kbd|1={{Lorem}}|spacing=0}} to get rid of the spacing: Шаблон:Lorem