Difference between revisions of "Template:Keypress/doc"

From MidrangeWiki
Jump to: navigation, search
m (creating /doc sub-page)
 
(adding information about using arrows in Template:keypress)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{Template doc page transcluded}}</includeonly><noinclude>{{Template doc page viewed directly}}</noinclude>
 
<includeonly>{{Template doc page transcluded}}</includeonly><noinclude>{{Template doc page viewed directly}}</noinclude>
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
==Usage==
+
=Documentation=
A template for illustrating keystrokes.
+
{{tl|keypress}} is a standard way to display one (1) to three (3) concurrent keyboard keystrokes, connected by the {{code|+}} sign if there are two or more parameters.
 +
 
 +
==Parameters==
 +
*Positional parameter {{code|1}} is required and can be a single letter or string
 +
*Positional parameters {{code|2}} and {{code|3}} are optional and can be single letters or strings
 +
*Named parameter {{code|background}} is optional and is in one of the following formats:
 +
:Six digit hex color code, including the leading {{code|#}} symbol
 +
::or
 +
:The text name of one of the sixteen colors of the HTML 4.01 specification [[wikipedia:HTML color names|HTML color names]]
 +
 
 +
<pre>{{keypress
 +
| letter(s) for first key box
 +
| (optional parameter) letter(s) for second key box
 +
| (optional parameter) letter(s) for third key box
 +
| (optional parameter) background=
 +
}}</pre>
 +
 
 +
===Arrows===
 +
Arrows can be placed inside the template by using the [[wikipedia:List_of_XML_and_HTML_character_entity_references]] as shown below.  Due to wiki-substitution the leading {{code|&}} sign was not included in the "code" columns.
 +
{| style="position:relative; margin: 0 0 0.5em 1em; border-collapse: collapse;  background:white; clear:right; text-align:center;" border="1" cellpadding="7"
 +
|-
 +
! rowspan="2" | Description
 +
! colspan="3" | Single line
 +
! colspan="3" | Double line
 +
|-
 +
! code<br>(add leading &)
 +
! colspan="2" | sample
 +
! code<br>(add leading &)
 +
! colspan="2" | sample
 +
|-
 +
| Right arrow
 +
| rarr;
 +
| &rarr;
 +
| {{keypress|&rarr;}}
 +
| rArr;
 +
| &rArr;
 +
| {{keypress|&rArr;}}
 +
|-
 +
| Left arrow
 +
| larr;
 +
| &larr;
 +
| {{keypress|&larr;}}
 +
| lArr;
 +
| &lArr;
 +
| {{keypress|&lArr;}}
 +
|-
 +
| Up arrow
 +
| uarr;
 +
| &uarr;
 +
| {{keypress|&uarr;}}
 +
| uArr;
 +
| &uArr;
 +
| {{keypress|&uArr;}}
 +
|-
 +
| Down arrow
 +
| darr;
 +
| &darr;
 +
| {{keypress|&darr;}}
 +
| dArr;
 +
| &dArr;
 +
| {{keypress|&dArr;}}
 +
|-
 +
| Horizontal arrow
 +
| harr;
 +
| &harr;
 +
| {{keypress|&harr;}}
 +
| hArr;
 +
| &hArr;
 +
| {{keypress|&hArr;}}
 +
|}
 +
 
 
==Examples==
 
==Examples==
* <code><nowiki>{{keypress|Alt]}}+{{keypress|P}}</nowiki></code> produces {{keypress|Alt}}+{{keypress|P}}
+
{| style="position:relative; margin: 0 0 0.5em 1em; border-collapse: collapse; background:white; clear:right; text-align:center;" border="1" cellpadding="7"
* <code><nowiki>{{keypress|Ctrl}}+{{keypress|Alt}}+{{keypress|Del}}</nowiki></code> produces {{keypress|Ctrl}}+{{keypress|Alt}}+{{keypress|Del}}
+
! Code
Unicode icons can be used alongside the text:
+
! Result
* {{keypress|Shift}}
+
|-
* {{keypress|↵ Enter}}
+
| colspan=2 | Single parameter, single letter
* {{keypress|⌘ Cmd}}
+
|-
* {{keypress|⌥ Opt}}
+
|<pre>{{keypress|A}}</pre>
* {{keypress|Tab ⇆}}
+
|{{keypress|A}}
<includeonly>
+
|-
 +
| colspan=2 | Single parameter, multiple letters
 +
|-
 +
|<pre>{{keypress|Shift}}</pre>
 +
|{{keypress|Shift}}
 +
|-
 +
| colspan=2 | Multiple parameter, multiple letters
 +
|-
 +
|<pre>{{keypress|Ctrl|Alt|Del}}</pre>
 +
|{{keypress|Ctrl|Alt|Del}}
 +
|-
 +
| colspan=2 | Multiple parameter, multiple letters with {{code|background}}<code>=</code> parameter
 +
|-
 +
|<pre>{{keypress|Shift|F3|background=#FF00FF}}</pre>
 +
|{{keypress|Shift|F3|background=#FF00FF}}
 +
|-
 +
|<pre>{{keypress|Shift|F3|background=aqua}}</pre>
 +
|{{keypress|Shift|F3|background=aqua}}
 +
|}<includeonly>
 
<!-- ADD CATEGORIES BELOW THIS LINE -->
 
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Internal formatting templates|{{PAGENAME}}]
+
[[Category:Internal formatting templates|{{PAGENAME}}]]
 
</includeonly>
 
</includeonly>

Latest revision as of 13:53, 26 March 2008

48px This is the template documentation page for {{Keypress}}.
It is not intended to be viewed directly. If it uses variables, some links may appear broken. Do not replace these variables with hardcoded page names or URLs.

Documentation

{{keypress}} is a standard way to display one (1) to three (3) concurrent keyboard keystrokes, connected by the + sign if there are two or more parameters.

Parameters

  • Positional parameter 1 is required and can be a single letter or string
  • Positional parameters 2 and 3 are optional and can be single letters or strings
  • Named parameter background is optional and is in one of the following formats:
Six digit hex color code, including the leading # symbol
or
The text name of one of the sixteen colors of the HTML 4.01 specification HTML color names
{{keypress 
| letter(s) for first key box 
| (optional parameter) letter(s) for second key box
| (optional parameter) letter(s) for third key box
| (optional parameter) background=
}}

Arrows

Arrows can be placed inside the template by using the wikipedia:List_of_XML_and_HTML_character_entity_references as shown below. Due to wiki-substitution the leading & sign was not included in the "code" columns.

Description Single line Double line
code
(add leading &)
sample code
(add leading &)
sample
Right arrow rarr; rArr;
Left arrow larr; lArr;
Up arrow uarr; uArr;
Down arrow darr; dArr;
Horizontal arrow harr; hArr;

Examples

Code Result
Single parameter, single letter
{{keypress|A}}
A
Single parameter, multiple letters
{{keypress|Shift}}
Shift
Multiple parameter, multiple letters
{{keypress|Ctrl|Alt|Del}}
Ctrl+Alt+Del
Multiple parameter, multiple letters with background= parameter
{{keypress|Shift|F3|background=#FF00FF}}
Shift+F3
{{keypress|Shift|F3|background=aqua}}
Shift+F3