Module:Xpd/doc

This module is invoked from Template:Xpds and Template:Xpdp, expansion demo templates that show the call of a variable, parser function or template and its result, for documentation. The technical notes below apply to both templates.

For parameters with explicit positive integer names the integer is reduced by 1 in the result (just like for implicit names, due to the position taken by the template name in the calls of the templates xpds and xpdp).

Expressions for parameter values are replaced by their results.

Without affecting the result the template call is written in a normalized form :
 * Values of named parameters are trimmed.
 * Definitions of parameters with implicit or explicit positive integer names are ordered in ascending order; explicit names among them are removed; these parameters are put before the remaining ones. Multiple definitions of the same parameter are replaced by the final one.
 * In the case that parameter values (after the expansion mentioned above) contain braces, pipes and/or equal signs they are changed into,  ,  , and  , so that the parsing of the call is kept intact.

Examples:

gives:

gives

although  gives

Wikitext on the left
To display on the left-hand side the wikitext and not the rendering of the parameter values, some adjustments are made at that side :
 * is replaced by
 * square brackets are replaced by  and
 * newlines are replaced by
 * spaces are replaced by

In other cases there might still be differences.

Correct:

Limitation
Parameters with explicit or implicit positive integer names have to form a set {1, 2, .. k} without gaps. A template call with for example an undefined parameter 1 and a defined parameter 2 is not supported (where an undefined parameter should not be confused with a parameter which is assigned as value the empty string, these are supported) :

gives: