Editing
Template:Documentation
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} <!-- Categories and interwikis go at the bottom of this page. --> ==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 [[[XHTML|X]]][[HTML]] element {{tag|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|key press}}) and slight [[Cascading style sheets|CSS]] letter-spacing to suggest individually entered characters. It retains the default monospaced (non-proportional) font style of the {{tag|kbd|open}} element. Because it uses {{tag|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|samp}}, 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 {{em|must}} be explicitly named {{para|1}}, or the template will fail. (This is a limitation of the MediaWiki software, not the template.) It is always safer to use {{para|1}} syntax. It may be used as a container for {[tlx|var}}, {{tlx|varserif}} or {{tag|var}} when the example keyboard input contains or consists entirely of a variable. It may also be used with (but not inside) {{tlx|code}}, or with {{tag|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 {{para|spacing=no}} (or {{para|spacing=n}} or any other value), to get rid of the slight letter spacing, which can look awkward on long passages of input. Examples: * {{tnull|kbd|71077345}}: "Entering {{kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''." * {{tnull|kbd|1{{=}}ssh <nowiki>{{var|hostname}}</nowiki>}} with {{tnull|samp|%}}: "At the {{samp|%}} prompt, the user must enter {{kbd|1=ssh {{var|hostname}}}}." * {{tnull|kbd|1{{=}}ssh <nowiki>{{var|hostname}}</nowiki>}} with {{tnull|samp|%}} and {{tnull|key press|Enter}}: "At the {{samp|%}} prompt, the user must input {{kbd|1=ssh {{var|hostname}}}}{{key 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 {{key press|Enter}}." * {{tnull|kbd|1{{=}}<nowiki>{{lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{kbd|1={{lorem}}|spacing=0}} <!--The section below only makes sense if you remember that when /doc pages are included into the template page they belong to, their background is light green! -->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: <div style="background:#FFFFFF;"> * {{tnull|kbd|71077345}}: "Entering {{kbd|71077345}} on a calculator and turning it upside down appears to spell ''[[Royal Dutch Shell|ShellOil]]''." * {{tnull|kbd|1{{=}}ssh <nowiki>{{var|hostname}}</nowiki>}} with {{tnull|samp|%}}: "At the {{samp|%}} prompt, the user must enter {{kbd|1=ssh {{var|hostname}}}}." * {{tnull|kbd|1{{=}}ssh <nowiki>{{var|hostname}}</nowiki>}} with {{tnull|samp|%}} and {{tnull|key press|Enter}}: "At the {{samp|%}} prompt, the user must input {{kbd|1=ssh {{var|hostname}}}}{{key 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 {{key press|Enter}}." * {{tnull|kbd|1{{=}}<nowiki>{{lorem}}</nowiki>|spacing{{=}}0}} to get rid of the spacing: {{kbd|1={{lorem}}|spacing=0}} </div><!-- The section above only makes sense if you remember that when /doc pages are included into the template page they belong to, their background is light green! --> == See also == {{Var/seealso}} <includeonly> <!-- Categories and interwikis go here: --> [[Category:Programming typing-aid templates|{{PAGENAME}}]] [[Category:Semantic markup templates|{{PAGENAME}}]] [[Category:Wikipedia XHTML tag-replacing templates|{{PAGENAME}}]] </includeonly>
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Documentation subpage
(
edit
)
Template:Em
(
edit
)
Template:Kbd
(
edit
)
Template:Key press
(
edit
)
Template:Lorem
(
edit
)
Template:Para
(
edit
)
Template:Samp
(
edit
)
Template:Tag
(
edit
)
Template:Tlx
(
edit
)
Template:Tnull
(
edit
)
Template:Var
(
edit
)
Template:Var/seealso
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information