Difference between revisions of "Template:Cite compare/sandbox"
imported>Jonesey95 m (Fix invalid self-closed HTML tag or other HTML Tidy-related tag error) |
imported>Trappist the monk |
||
Line 1: | Line 1: | ||
{| class = wikitable width=100% | {| class = wikitable width=100% | ||
|+{{#ifeq:{{lc:{{{mode}}}}}|citation|Citation |Cite {{{mode}}}}} compare | |+{{#ifeq:{{lc:{{{mode}}}}}|citation|Citation |Cite {{{mode}}}}} compare | ||
− | | style="background:#FFFFFF; padding-left:1em;" colspan = 2 | {{#invoke: | + | | style="background:#FFFFFF; padding-left:1em;" colspan = 2 | {{#invoke:Template wrapper/sandbox|list|_template={{#ifeq:{{lc:{{{mode}}}}}|citation|citation |cite {{{mode}}}}}|_exclude=old,mode,comment,sandbox}} |
{{#if:{{{old|}}}|| | {{#if:{{{old|}}}|| | ||
{{!}}- | {{!}}- | ||
− | {{!}}width{{=}}4em style{{=}}"background:#DDDDDD;" {{!}} Old {{!}}{{!}} style{{=}}"padding-left:0.5em;" {{!}} <includeonly>{{#invoke: | + | {{!}}width{{=}}4em style{{=}}"background:#DDDDDD;" {{!}} Old {{!}}{{!}} style{{=}}"padding-left:0.5em;" {{!}} <includeonly>{{#invoke:Template wrapper/sandbox|wrap|_template=cite {{{mode|}}}/old|_exclude=mode,comment,sandbox,old }}</includeonly> }} |
|- | |- | ||
− | |width=4em style="background:#DDDDDD;" | Live || style="padding-left:0.5em;" | <includeonly>{{#invoke: | + | |width=4em style="background:#DDDDDD;" | Live || style="padding-left:0.5em;" | <includeonly>{{#invoke:Template wrapper/sandbox|wrap|_template=cite {{{mode|}}}|_exclude=mode,comment,sandbox,old }}</includeonly> |
{{#if:{{{sandbox|}}}{{{old|}}}| | {{#if:{{{sandbox|}}}{{{old|}}}| | ||
{{!}}- | {{!}}- | ||
− | {{!}}width{{=}}4em style{{=}}"background:#DDDDDD;" {{!}} Sandbox {{!}}{{!}} style{{=}}"padding-left:0.5em;" {{!}} <includeonly>{{#invoke: | + | {{!}}width{{=}}4em style{{=}}"background:#DDDDDD;" {{!}} Sandbox {{!}}{{!}} style{{=}}"padding-left:0.5em;" {{!}} <includeonly>{{#invoke:Template wrapper/sandbox|wrap|_template=cite {{{mode|}}}/new|_exclude=mode,comment,sandbox,old }}</includeonly> }}{{#if:{{{comment|}}}|<nowiki/> |
− | |||
− | |||
{{!}}- | {{!}}- | ||
− | {{!}} style="background:#FFFFFF; padding-left:1em;" colspan = 2 {{!}} {{{comment}}} }} | + | {{!}} style="background:#FFFFFF; padding-left:1em;" colspan = 2 {{!}} {{{comment}}}}} |
|} | |} | ||
<noinclude> | <noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 12:35, 20 May 2018
{{cite {{{mode}}} |}}
| |
Old | |
Live |
![]() | This is the template sandbox page for Template:Cite compare (diff). See also the companion subpage for test cases. |
{{cite compare}} is a debug and documentation tool that allows editors to compare the output created by the various versions of a Citation Style 1 (CS1) template. To invoke {{cite compare}} simply add CS1 template parameters to {{cite compare}}
. For example, a simple {{cite web}} comparison might look like this:
{{cite compare |mode=web |url=http://www.example.com |website=Example Website |title=Example comparison}}
which produces this output:
WT | {{cite web |url=http://www.example.com |website=Example Website |title=Example comparison}}
|
---|---|
Live | "Example comparison". Example Website. |
Sandbox | Lua error in Module:Citation/CS1/sandbox at line 126: Argument map not defined for this variable. |
Usage
The default display is a comparison between sandbox and the current live CS1 template.
{{cite compare}} is controlled by four parameters:
|mode=
– selects which of the CS1 templates will be compared; for{{cite web}}
,|mode=web
; for{{cite journal}}
,|mode=journal
; etc.|old=
– when set toyes
, includes the citation as rendered by{{citation/core}}
|comment=
– when set to a comment, displays the comment at the bottom of the comparison table|header=
– when set, displays additional header text|nosandbox=
– when set, removes the line for the sandbox
Display only live
{{cite compare |mode=web |nosandbox=yes |url=http://www.example.com |website=Example Website |title=Example comparison}}
WT | {{cite web |title=Example comparison |website=Example Website |url=http://www.example.com}}
|
---|---|
Live | "Example comparison". Example Website. |
Compare old, live and sandbox
Adding |old=yes
will display a comparison of all three versions of a CS1 citation: the current live template, the sandbox template, and the old, pre-Lua-based versions. The non-Lua-based templates are at pages labeled old; for example, {{cite web/old}} is the reference version against which the initial Lua implementation to {{cite web}} were compared.
{{cite compare |mode=web |old=yes |url=http://www.example.com |website=Example Website |title=Example comparison}}
WT | {{cite web |title=Example comparison |website=Example Website |url=http://www.example.com}}
|
---|---|
Old | "Example comparison". http://www.example.com. |
Live | "Example comparison". Example Website. |
Sandbox | Lua error in Module:Citation/CS1/sandbox at line 126: Argument map not defined for this variable. |
Compare with comment
To add a comment regarding the comparison, set |comment=<comment text>
. If <comment text> contains a vertical bar or pipe (|) use {{!}}
.
{{cite compare |mode=web |comment=Comment about {{!}}comment=<comment text> |header=(additional header text) |url=http://www.example.com |website=Example Website |title=Example comparison}}
WT | {{cite web |url=http://www.example.com |website=Example Website |title=Example comparison}}
|
---|---|
Live | "Example comparison". Example Website. |
Sandbox | Lua error in Module:Citation/CS1/sandbox at line 126: Argument map not defined for this variable. |
Comment about |comment=<comment text> |
The above documentation is transcluded from Template:Cite compare/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |