Template:Xpdoc/doc: Difference between revisions
More actions
→More examples: workaround for disabling of section editing in Template:TemplateBox |
mNo edit summary |
||
| Line 41: | Line 41: | ||
==More examples== | ==More examples== | ||
{{sed|1}} | |||
<code><nowiki>{{xpdoc|ISOdate|2009-04-03}}</nowiki></code> produces: "{{xpdoc|ISOdate|2009-04-03}}". | <code><nowiki>{{xpdoc|ISOdate|2009-04-03}}</nowiki></code> produces: "{{xpdoc|ISOdate|2009-04-03}}". | ||
<includeonly>[[Category:Expansion demo templates]]</includeonly> | <includeonly>[[Category:Expansion demo templates]]</includeonly> | ||
Revision as of 06:36, 20 September 2010
The expansion demo templates show, for documentation:
- some wikitext
- its rendering
without the need of repeating the parameters in the wikitext.
Naming scheme:
- o = double opening braces
- c = double closing braces
This template combines the functionality of templates listed in m:Help:Expansion demo templates with a single o and c (no nesting), but with some restrictions.
Usage
{{xpdoc |1= |2= |gives= }}
In the case of demonstrating a template, values of unnamed parameters of this template are trimmed, so Template:Xpdoc cannot be used for demonstrating the effect of spaces at the start or end of an unnamed parameter.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | name of parser function, a colon, and the first parameter, or name of template | empty | required | |
2 | the parameter after the first pipe | empty | optional | |
gives | text (or the empty string) to replace the word "gives", e.g. gives={{!}}{{!}} to produce "||", for use in a table | gives | optional | |
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: all users
Example
{{xpdoc|Creator:Vincent van Gogh}}
renders as:
{{Creator:Vincent van Gogh}} → Template:Creator:Vincent van Gogh
See also
More examples
{{xpdoc|ISOdate|2009-04-03}} produces: "{{ISOdate|2009-04-03}} → 3 April 2009".