A keyword is something that matches a piece of text, and optionally some kind of reminder text can be shown.
--Properties--
! Property Type Default Description
| @keyword@ [[type:string]] ''required'' Name of the keyword.
| @match@ [[type:string]] ''required'' String to match.
| @reminder@ [[type:scriptable]] [[type:string]] ''required'' Script to generate the reminder text of this keyword.
| @rules@ [[type:string]] @""@ Explanation or additional rules for this keyword.
| @mode@ Name of a [[type:keyword mode]] Mode of this keyword.
The match string can include parameters, @"<atom-param>type</atom-param>"@ where @"type"@ is the name of a [[type:keyword param type|keyword parameter type]] in the game.
These will match according to the @match@ property of that parameter type.
When expanding the reminder text @param1@ refers to the first parameter in the match string, @param2@ to the second, etc.
--Example--
>keyword:
> keyword: Equip
> match: Equip <atom-param>cost</atom-param>
> mode: core
> reminder: {param1}: Attach to target creature you control. Equip only as a sorcery.
This becomes a choice in the 'mode' box on the keywords panel.
The idea behind modes is that a mode indicates what type of keyword it is, for example an "official" keyword, a "simple" keyword or a "custom" keyword.
This information can then be used to determine whether to expand the reminder text.
--Properties--
! Property Type Default Description
| @name@ [[type:string]] ''required'' Name of the mode, this is shown in the box and used in scripts.
| @description@ [[type:string]] @""@ A description of this mode.
| @is default@ [[type:boolean]] @false@ Is this the default mode for new keywords?
A type of parameter that can be used in a [[type:keyword]].
--Properties--
! Property Type Default Description
| @name@ [[type:string]] ''required'' Name of the parameter type.
| @description@ [[type:string]] ''required'' Description of the parameter type.
| @placeholder@ [[type:string]] @name@ of this param type Placeholder to use for empty parameters, the name is used if this is empty.
| @optional@ [[type:boolean]] @true@ Is a placeholder used when a keyword is encountered with no parameter,<br/> for example @"Cycling "@ would become @"Cycling <atom-kwpph>cost</atom-kwpph>"@.
| @match@ [[type:regex]] ''required'' Regular expression that this param type matches.
| @separator before is@ [[type:regex]] @""@ Regular expression of separator before parameters of this type.
| @separator after is@ [[type:regex]] @""@ Regular expression of separator after parameters of this type.
| @eat separator@ [[type:boolean]] @true@ Allow the user to 'type over' the separator.<br/>
For example if the separator is @" "@ in the keyword @"Cycling"@, and the user types @"Cycling"@,
a space and a placeholder is automatically inserted, making @"Cycling <cost>"@.
If the user now presses space the cursor is only moved, no additional space is inserted, the space is 'eaten'.
| @script@ [[type:script]] Script to apply to parameters of this type before substituting them back into the text.
| @reminder script@ [[type:script]] Script to apply to parameters of this type before using them in the reminder text.
| @example@ [[type:string]] Example for in the keyword editor, currently not used.
| @refer scripts@ [[type:list]] of [[type:keyword param reference script]]s
Scripts for inserting paramaters of this type into the reminder text.
To make this easy for the user, a menu of ways to use a parameter is provided.
--Example--
The 'number' parameter type. It matches a sequence of digits.
It can be included in the reminder text directly, or by applying some function first.