Difference between revisions of "Template:Cmd/doc"

From Wiki
Jump to navigation Jump to search
(Create documentation)
 
(Update documentation to reflect new link=no parameter)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
  
Link to a command; any text in the second template parameter is comes right after the command, in typewriter font. Passing parameters is optional.
+
Link to a ConTeXt command in the [[:Category:Commands|command reference]]. You can mention some parameters while you're at it; and you can mention the command without linking to it by specifying {{code|1=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:
 
Usage:
  
     <nowiki>{{cmd|startalignment}}</nowiki>
+
     <nowiki>{{cmd|framed}}</nowiki>
     <nowiki>{{cmd|startalignment|[middle]}}</nowiki>
+
     <nowiki>{{cmd|framed|{text}}}</nowiki>
     <nowiki>{{cmd|section|{First section}}}</nowiki>
+
    <nowiki>{{cmd|framed|2=[width=2em]{text}}}</nowiki>
 +
    <nowiki>{{cmd|framed|link=no}}</nowiki>
 +
    <nowiki>{{cmd|framed|2=[width=2em]{text}|link=no}}</nowiki>
 +
     <nowiki>{{cmd|framed|2=[width=2em]{text}|link=stuff}}</nowiki>
  
 
Result:
 
Result:
  
     <nowiki><tt>[[Command/startalignment|\startalignment]]</tt></nowiki>
+
     <nowiki><tt>[[Command/framed|\framed]]</tt></nowiki>
     <nowiki><tt>[[Command/startalignment|\startalignment]][middle]</tt></nowiki>
+
     <nowiki><tt>[[Command/framed|\framed]]{text}</tt></nowiki>
     <nowiki><tt>[[Command/startalignment|\startalignment]]{First section}</tt></nowiki>
+
     <nowiki><tt>[[Command/framed|\framed]][width=2em]{text}</tt></nowiki>
 
+
    <nowiki><tt>\framed</tt></nowiki>
 +
    <nowiki><tt>\framed[width=2em]{text}</tt></nowiki>
 +
    '''(A warning)'''
  
 
Display:
 
Display:
  
* {{cmd|startalignment}}
+
* {{cmd|framed}}
* {{cmd|startalignment|[middle]}}
+
* {{cmd|framed|{text}}}
* {{cmd|section|{First section}}}
+
* {{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}}

Revision as of 13:36, 20 July 2012

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:

  • \framed
  • \framed{text}
  • \framed[width=2em]{text}
  • \framed
  • \framed[width=2em]{text}
  • Error in {{cmd}} template: the only valid values for link are yes, no, or leaving it unspecified.