ଛାଞ୍ଚ:Cite compare/doc
This is a documentation subpage for ଛାଞ୍ଚ:Cite compare. It may contain usage information, categories and other content that is not part of the original ଛାଞ୍ଚ page. |
{{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. The tool was developed to aid in the migration of the CS1 templates from the {{citation/core}}
engine to Module:Citation/CS1 Lua engine.
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:
{{cite web
| |
Old | "Example comparison". http://www.example.com. |
Live | "Example comparison". Example Website. |
Usage
[ସମ୍ପାଦନା]The default display is a comparison between the old {{citation/core}}
-based CS1 template and the current live CS1 template. Because the tool was developed to compare the new Lua-based versions of a CS1 templates against the older {{citation/core}}
reference templates, the reference template are moved to a subpage labeled old. For example, {{cite web/old}}
is the reference version against which the initial Lua implementation ot {{cite web}}
were compared.
{{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.|sandbox=
– when set toyes
, includes the citation as rendered by Module:Citation/CS1/sandbox|old=
– when set tono
, does not include the citation as rendered by{{citation/core}}
; includes the citation as rendered by Module:Citation/CS1/sandbox|comment=
– when set to a comment, displays the comment at the bottom of the comparison table
Compare old, live and sandbox
[ସମ୍ପାଦନା]Adding |sandbox=yes
will display a comparison of all three versions of a CS1 citation:
{{cite compare |mode=web |sandbox=yes |url=http://www.example.com |website=Example Website |title=Example comparison}}
{{cite web
| |
Old | "Example comparison". http://www.example.com. |
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
Compare live and sandbox
[ସମ୍ପାଦନା]As more of the CS1 templates are migrated to Module:Citation/CS1 and new features / enhancements are added, it becomes less important to compare the sandbox version to the old version. Setting |old=no
displays a comparison between the live and sandbox versions.
{{cite compare |mode=web |old=no |url=http://www.example.com |website=Example Website |title=Example comparison}}
{{cite web
| |
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
Though perfectly acceptable, simultaneously setting |old=no
and |sandbox=yes
is the same as simply setting |old=no
.
{{cite compare |mode=web |sandbox=yes |old=no |url=http://www.example.com |website=Example Website |title=Example comparison}}
{{cite web
| |
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 |mode=web |sandbox=yes |comment=Comment about {{!}}comment=<comment text> |url=http://www.example.com |website=Example Website |title=Example comparison}}
{{cite web
| |
Old | "Example comparison". http://www.example.com. |
Live | "Example comparison". Example Website. |
Sandbox | "Example comparison". Example Website. |
Comment about |comment=<comment text> |
See also
[ସମ୍ପାଦନା]{{cite compare2}}
– for a live-only display