Template:Xpd oldpp/doc

This (expansion demo) shows the call of a variable, parser function or template and its result, for documentation. It works with unnamed parameters only.


 * Usage&#58;

Please note that for parser functions the first parameter belongs to the left side before "|".

Examples without additional parameters:

{&#123;subst:xpd oldpp|uc:Upper Case|subst=subst:&#125;} substitutes {&#123; &#160; &#125;} UPPER CASE

See Help:Substitution for several caveats wrt subst=subst:.

Note that, as always, a parameter containing "=" has to be explicitly named by putting, in this case, "1=" in front.

Examples with additional parameters (no nesting possible):

In the case of one or more named parameters, write all parameter definitions from that as value of the appropriate parameter number, e.g.:
 * gives ""

Optional substitution with subst=subst: is not supported. The demo template shows what another template actually does, and not what it did some time ago.

Separator parameter

 * Usage&#58;


 * The default separator is "gives", use s== or similar to get "=" etc.

Examples with separator parameter:

Named parameters
Named parameters are not supported.

Rendering of left side
The left-hand side, before "gives", does not show the literal wikitext of the parameters of the template or parser function demonstrated, but the rendering. This affects e.g. sequences of more than two spaces, and single newlines. Also link code is shown as a link. Furthermore, any templates and parser functions in the parameters are expanded; covers the simpler of such cases.

However, the right-hand side gives the correct result, even if parameters start or end with a space or newline.

Examples:

""

gives:

""

With substitution of xpd oldpp1 etc. (see below) and putting nowiki tags around the list of parameters the left hand side is corrected.

Substitution

 * tc gives the wikitext
 * t1 gives the wikitext
 * t2 gives the wikitext
 * concat gives the wikitext

Note that except in the case of long and complicated parameters, adding the number of parameters after "xpd oldpp" is easier than adding "|substnp=subst:".

With substitution of xpd oldpp1 etc. and putting nowiki tags around the list of parameters the left hand side is given literally without conversions, see also above.