Open main menu

Changes

replace [cmd]...[/cmd] with cmd:... wikilinks, as the showcommand Javascript doesn't work.
The 'key' to the keyval functionality in ConTeXt are two macros called
<[[cmd>:getparameters</cmd> |\getparameters]] and <[[cmd>:processaction|\processaction</cmd>]].
Here is a 'quickstart', assuming you want to define <tt>\MyZigzag</tt>:
</texcode>
If you want to use keyword values, then you also need to use <[[cmd>:processaction</cmd>|\processaction]].
Say you want "Dir" to be mandatory and that it accepts 4 directional keywords, as well as a direct angle specification.
<tt>\s!default</tt> may be triggered because <tt>\ZZDir</tt>'s expansion is empty unless the user supplied something.
The first argument to <[[cmd>:processaction</cmd> |\processaction]] has to be expanded, so you need the <[[cmd>:expandafter|\expandafter</cmd>]]s.
for completeness, here is an example definition of <tt>\checkDir</tt> and <tt>\errorDir</tt>: