Difference between revisions of "Template:Cmd"
Jump to navigation
Jump to search
(Make commands print in typewriter font, just like the old cmd tags.) |
m (moved Template:cmd to Template:Cmd: move to Uppercase) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <tt>[[Command/{{{1}}}|\{{{1}}}]]</tt> | + | {{#switch: {{{link|yes}}} |
+ | | yes = <tt>[[Command/{{{1}}}|\{{{1}}}]]{{{2|}}}</tt> | ||
+ | | no = <tt>\{{{1}}}{{{2|}}}</tt> | ||
+ | | #default = '''Error in {{tl|cmd}} template: the only valid values for {{code|link}} are {{code|yes}}, {{code|no}}, or leaving it unspecified.''' | ||
+ | }}<noinclude> | ||
+ | ---- | ||
+ | {{documentation}} | ||
+ | </noinclude> |
Latest revision as of 14:49, 18 September 2012
[[Command/{{{1}}}|\{{{1}}}]]
Link to a ConTeXt command in the command reference. You can mention some parameters while you're at it; and you can mention the command without linking to it by specifying link=no
.
When the text passed to one of the template parameters contains an equals sign, you must explicitly address that template parameter by name or number. This will usually happen with template parameter 2, which is used to specify the ConTeXt parameters.
Usage:
{{cmd|framed}} {{cmd|framed|{text}}} {{cmd|framed|2=[width=2em]{text}}} {{cmd|framed|link=no}} {{cmd|framed|2=[width=2em]{text}|link=no}} {{cmd|framed|2=[width=2em]{text}|link=stuff}}
Result:
<tt>[[Command/framed|\framed]]</tt> <tt>[[Command/framed|\framed]]{text}</tt> <tt>[[Command/framed|\framed]][width=2em]{text}</tt> <tt>\framed</tt> <tt>\framed[width=2em]{text}</tt> (A warning)
Display:
The above documentation is transcluded from Template:Cmd/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |