Template:Cite compare: Difference between revisions
Richardpruen (talk | contribs) m (1 revision imported) |
imported>Trappist the monk (|template= to alias |mode= so that cs1|2 |mode= parameter can be demo'd / tested;) |
||
Line 1: | Line 1: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+{{#ifeq:{{lc:{{{mode}}}}}|citation|Citation |Cite {{{mode}}}}} comparison{{#if:{{{header|}}}| {{{header}}}}} | |+{{#ifeq:{{lc:{{{template|{{{mode}}}}}}}}|citation|Citation |Cite {{{template|{{{mode}}}}}}}} comparison{{#if:{{{header|}}}| {{{header}}}}} | ||
! scope="row" | Wikitext | ! scope="row" | Wikitext | ||
| {{#invoke:Template wrapper|list|_template={{#ifeq:{{lc:{{{mode}}}}}|citation|citation |cite {{{mode}}}}}|_exclude=old,mode,comment,nosandbox,header}} | | {{#invoke:Template wrapper|list|_template={{#ifeq:{{lc:{{{template|{{{mode}}}}}}}}|citation|citation |cite {{{template|{{{mode}}}}}}}}|_exclude=old, {{#if:{{{template|}}}||mode,}} template, comment,nosandbox,header}} | ||
{{#ifeq:{{{old|}}}|yes| | {{#ifeq:{{{old|}}}|yes| | ||
{{!}}- | {{!}}- | ||
! scope="row" {{!}} Old | ! scope="row" {{!}} Old | ||
{{!}} <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{mode | {{!}} <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{template|{{{mode}}}}}}/old|_exclude={{#if:{{{template|}}}||mode,}} template, comment,nosandbox,header,old }}</includeonly>}} | ||
|- | |- | ||
! scope="row" | Live | ! scope="row" | Live | ||
| <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{mode | | <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{template|{{{mode}}}}}}|_exclude={{#if:{{{template|}}}||mode,}} template, comment,nosandbox,header,old }}</includeonly>{{#if:{{{nosandbox|}}}||<nowiki/> | ||
{{!}}- | {{!}}- | ||
! scope="row" {{!}} Sandbox | ! scope="row" {{!}} Sandbox | ||
{{!}} class="cs1-sandbox" {{!}} <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{mode | {{!}} class="cs1-sandbox" {{!}} <includeonly>{{#invoke:Template wrapper|wrap|_template=cite {{{template|{{{mode}}}}}}/new|_exclude={{#if:{{{template|}}}||mode,}} template, comment,nosandbox,header,old }}</includeonly>}}{{#if:{{{comment|}}}|<nowiki/> | ||
{{!}}- | {{!}}- | ||
{{!}} colspan="2" {{!}} {{{comment}}}}} | {{!}} colspan="2" {{!}} {{{comment}}}}} |
Latest revision as of 19:06, 10 April 2023
Wikitext | {{cite {{{mode}}}}}
|
---|---|
Live | |
Sandbox |
{{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:
Wikitext | {{cite web
|
---|---|
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
Usage
The default display is a comparison between sandbox and the current live CS1 template.
{{cite compare}} is controlled by four parameters:
|template=
– selects which of the CS1 templates will be compared; for {{cite web}},|template=web
; for {{cite journal}},|template=journal
; etc.; alias:|mode=
(deprecated)|mode=
– deprecated alias of|template=
; for {{cite web}},|mode=web
; for {{cite journal}},|mode=journal
; etc.; deprecated because cs1|2 supports a parameter called|mode=
|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 |template=web |nosandbox=yes |url=http://www.example.com |website=Example Website |title=Example comparison}}
Wikitext | {{cite web
|
---|---|
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 |template=web |old=yes |url=http://www.example.com |website=Example Website |title=Example comparison}}
Wikitext | {{cite web
|
---|---|
Old | "Example comparison". http://www.example.com. |
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
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 |template=web |comment=Comment about {{!}}comment=<comment text> |header=(additional header text) |url=http://www.example.com |website=Example Website |title=Example comparison}}
Wikitext | {{cite web
|
---|---|
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
Comment about |comment=<comment text> |