Module:data/magic words/documentation

This module contains data relating to the MediaWiki magic words which are enabled on the English Wiktionary.

There are three types of magic word: Many magic words can act as a parser variable or parser function, but others can only be one or the other.
 * Parser variables, which cannot take arguments (e.g. PAGENAME).
 * Parser functions, which take argument 0 after a colon (e.g. bar), and can take further arguments.
 * Transclusion modifiers, which are used as colon-separated prefixes to templates or other magic words (e.g. SUBST:foo). These can be stacked with each other (but see the key below.

Keys

 * Specifies that the magic word can be used as a parser variable. The value is a wikilink target to a documentation page.
 * Specifies that the magic word can be used as a parser variable. The value is a wikilink target to a documentation page.


 * Specifies that the magic word can be used as a parser function. In most cases, the value is a wikilink target to a documentation page; in a small number of cases, the value is a table, because the most suitable link depends on whether argument 1 (i.e. the first argument after a pipe) has been given. In such cases, the table has two keys: key is the link target when argument 1 has not been given, and key  is the link target when it has. For example, compare the PROTECTIONEXPIRY link targets for PROTECTIONEXPIRY:foo and bar.
 * Specifies that the magic word can be used as a parser function. In most cases, the value is a wikilink target to a documentation page; in a small number of cases, the value is a table, because the most suitable link depends on whether argument 1 (i.e. the first argument after a pipe) has been given. In such cases, the table has two keys: key is the link target when argument 1 has not been given, and key  is the link target when it has. For example, compare the PROTECTIONEXPIRY link targets for PROTECTIONEXPIRY:foo and bar.


 * Specifies that the magic word can be used as a transclusion modifier. The value is a wikilink target to a documentation page.
 * Specifies that the magic word can be used as a transclusion modifier. The value is a wikilink target to a documentation page.


 * The canonical name for the magic word. In most cases, this will be the same as the key. Note that this should not be specified in the data directly, as it is generated automatically. Instead, the key can be used to give a table of aliases for the magic word, which are automatically converted into table keys with the same data as the canonical name when the table is returned. The  key is not present in the returned data, however.
 * The canonical name for the magic word. In most cases, this will be the same as the key. Note that this should not be specified in the data directly, as it is generated automatically. Instead, the key can be used to give a table of aliases for the magic word, which are automatically converted into table keys with the same data as the canonical name when the table is returned. The  key is not present in the returned data, however.


 * Specifies that the magic word is case-sensitive. In all cases, case-sensitive magic words must be given in uppercase, and any aliases have the same case-sensitivity as the canonical name. The distribution between the two is essentially random, with the split being close to 50/50.
 * Specifies that the magic word is case-sensitive. In all cases, case-sensitive magic words must be given in uppercase, and any aliases have the same case-sensitivity as the canonical name. The distribution between the two is essentially random, with the split being close to 50/50.


 * Only used with transclusion modifiers. Specifies the order they must be given in when stacked together. For instance, a magic word with priority 2 can only be stacked after one with priority 1 and stacked before one with priority 3; compare SUBST:MSG:foo (both modifiers applied to Template:foo), and MSG:SUBST:foo (MSG applied to Template:SUBST:foo).
 * Only used with transclusion modifiers. Specifies the order they must be given in when stacked together. For instance, a magic word with priority 2 can only be stacked after one with priority 1 and stacked before one with priority 3; compare SUBST:MSG:foo (both modifiers applied to Template:foo), and MSG:SUBST:foo (MSG applied to Template:SUBST:foo).