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).

Without affecting the result a 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.
 * Expressions for parameter values are replaced by their result.

Example:

gives:

Limitations
The left-hand side does not show the wikitext but the rendering of the parameter values. This affects e.g. sequences of more than two spaces, and single newlines. Also link code is shown as a link.

gives:

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: