Help:Command reference

From ConTeXt wiki
Jump to: navigation, search

This page is about editing command reference pages. For editing this wiki in general, see ConTeXt_wiki:Editing.

The command reference pages under Commands have a common structure: a rather typical syntax usage table at the top, followed by a description, some examples, and suggestions for other pages to look at. These sections are described below.

If you want to create a new command page, skip ahead to the Command page template section below.

Contents

The structure of a command reference page

Syntax

A table, implemented in HTML for now, that is set up along the following lines.

\XXX[...][...][...]
[...] text
key value
key default variant other
[...] text

Let us examine the following example:

\placefloat[...][ref,ref,...]{...}{...}
[...]left right here top bottom inleft inright inmargin margin leftmargin rightmargin leftedge rightedge innermargin outermargin inneredge outeredge inner outer regel high low fit page opposite always force tall reset line height depth
[ref,ref,...]
{...}text
{...}text

You would not type \placefloat in your TeX-text, but rather a previously defined kind of float, figure for example. So the command would be \\placefigure. The first two arguments of \placefloat are optional (red color), the second two are mandatory. The first argument takes one of the mentioned keywords. If not given, it uses the one in bold: here. ref stands for a reference label; just insert a name that you want to refer to later. In the third and fourth argument text is in italics; so it is not a keyword, but a (terse) description of what you can enter. In this case, you can enter any kind of text.

Description

This is for describing what the command does. How does it affect the layout? Does it create other commands, like \defineparagraphs[MyPars] creates \startMyPars and \setupMyPars? Does it need specific circumstances, like \setuparranging[XY] requires \setuppaper[nx=..., ny=...] to be set first?

Example

Preferably a compiled example created with <context source=yes>...</context>, but if the example won't compile, or the result does not display well, then <texcode>...</texcode> is also acceptable.

See also

You want a bulleted list here, practically always. Link to commands with the {{cmd}} template, to the relevant source files with the {{src}} template, and to pages with ordinary [[wikilinks]].

Categories

All commands should have at least one category link of the form [[Category:Command/Subcategory|somecommand]]. You can visit Category:Commands to see the ones that are not yet categorized. Putting a page in multiple categories is encouraged.

Navboxes

See {{Columns navbox}} for an example, and Wikiproject Navboxes for navboxes in general. The eventual intention is to have a navbox on every page, with three (or four groups) in it:

This would neatly bind together the various kinds of documentation this wiki provides, and equally bind together related commands and pages, and look neat on every page.

Command page template

To create a new command page, navigate to the page you want to create, (e.g. Command/thecommandinquestion,) and copy the template below. The {{subst:SUBPAGENAME}} template means the insertion of the proper command name is taken care of.

{{Reference
|name={{subst:SUBPAGENAME}}
|attributes=
}}

== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
  <tr>
    <td colspan="2" class="cmd">\{{subst:SUBPAGENAME}}<!--
      --><span class="first">[...]</span><!--
      --><span class="second">[...]</span><!--
      --><span class="third">[...]</span><!--
 --></td>
  </tr>
  <tr valign="top" class="first">
    <td class="cmd">[...]</td>
    <td>''text''</td>
  </tr>
  <tr valign="top" class="second">
    <td class="cmd">[...]</td>
    <td>''text''</td>
  </tr>
  <tr valign="top" class="third">
    <td class="cmd">[...]</td>
    <td>''text''</td>
  </tr>
</table>

== Description == 


== Example ==
<!-- something like this:
<context source=yes>
...
</context>
Or use <texcode> tags if the example doesn't compile on this wiki
-->

== See also ==
<!-- something like this:
* {{cmd|setuphead}}
* {{src|strc-sec.mkiv#l299}}
-->

== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{subst:SUBPAGENAME}}}}

[[Category:Commands|{{subst:SUBPAGENAME}}]]


C O N T E X T G A R D E N

Personal tools
Namespaces
Variants
Actions
Help
External Help
Installation
Navigation
Toolbox