Jump to content

Template:Xpdoc/doc

From mediawiki.org

See m:Meta:Expansion demo templates.

"[[{{{1}}}]]" gives "{{{{{1}}}}}" [1]

Examples

[edit]
{{xpdoc|d=|CURRENTDAY}} {{CURRENTDAY}} → 22 [2]
{{xpdoc|CURRENTDAY}} "{{CURRENTDAY}}" → "22" [3]
{{xpdoc|d=''|CURRENTDAY}} ''{{CURRENTDAY}}''22 [4]
{{xpdoc|#expr:2*3}} "{{#expr:2*3}}" → "6" [5]
{{xpdoc|urlencode:!}} "{{urlencode:!}}" → "%21" [6]
{{xpdoc|uc:abc}} "{{uc:abc}}" → "ABC" [7]

If the left side contains an equals sign, the named parameter 1 can and should be used:

{{xpdoc|1=#expr:2+2=4}} "{{#expr:2+2=4}}" → "1" [8]

Alternatives with Template:Demo inline

[edit]
{{demo inline|<nowiki>{{CURRENTDAY}}</nowiki>}} {{CURRENTDAY}} → 22
{{demo inline|<nowiki>"{{CURRENTDAY}}"</nowiki>}} "{{CURRENTDAY}}" → "22"
{{demo inline|<nowiki>''{{CURRENTDAY}}''</nowiki>}} ''{{CURRENTDAY}}''22