www.fgks.org   »   [go: up one dir, main page]

Jump to content

Template:Wikicite/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
PBS (talk | contribs)
→‎Examples: (see § Alternatives for more details):
-
 
(18 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{High-use}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{Uses TemplateStyles|Template:Citation/styles.css}}


{{tl|Wikicite}} creates an anchor, for use in a "References" section for books, journals, web references, etc. The anchor should be linked-to in the body of the article.
{{tl|Wikicite}} creates an anchor, for use in a "References" section for books, journals, web references, etc. The anchor should be linked-to in the body of the article.


The reference text may be formatted manually, and the template merely adds an anchor for linking from in-text citations. This template is also useful when using a citation template that does not support the {{para|ref}} parameter (for example, {{tl|London Gazette}}, but there are others).
The reference text may be formatted manually, and the template merely adds an anchor for linking from in-text citations. This template is also useful when using a citation template that does not support the {{para|ref}} parameter (for example, {{tl|ws}}).


'''This template is only needed for ''handwritten'' citations, or citations using non-standard citation templates, that are linked to by a [[WP:CITESHORT|shortened footnote]] or a [[WP:Parenthetical references|parenthetical reference]]'''. If you don't mind using a citation template, it is more standard to use {{tl|sfn}} or {{tl|harv}} with a template such as {{tl|citation}}, {{tl|cite book}}, {{tl|cite web}}, etc.
'''This template is only needed for ''handwritten'' citations, or citations using non-standard citation templates, that are linked to by a [[WP:CITESHORT|shortened footnote]] or a [[WP:Parenthetical references|parenthetical reference]]'''. If you don't mind using a citation template, it is more standard to use {{tl|sfn}} or {{tl|harv}} with a template such as {{tl|citation}}, {{tl|cite book}}, {{tl|cite web}}, etc.
Line 11: Line 12:


== Usage ==
== Usage ==
Cut-'n'-paste.
Copy-'n'-paste.
<nowiki>{{wikicite | id = | reference = }}</nowiki>
<syntaxhighlight lang="wikitext">{{wikicite | id = | reference = }}</syntaxhighlight>
or, alternatively (but not equivalently{{snd}}see below)
or, alternatively (but not equivalently{{snd}}see below)
<nowiki>{{wikicite | ref = | reference = }}</nowiki>
<syntaxhighlight lang="wikitext">{{wikicite | ref = | reference = }}</syntaxhighlight>


The {{para|id}} or {{para|ref}} parameters are alternative unique identifiers used for the reference link on the page, compatible with some other reference templates. If both {{para|id}} and {{para|ref}} are provided, {{para|id}} is ignored. There are two differences between these:
The first parameter is an alias for {{para|reference}}. The {{para|id}} or {{para|ref}} parameters are alternative unique identifiers used for the reference link on the page, compatible with some other reference templates. If both {{para|id}} and {{para|ref}} are provided, {{para|id}} is ignored. There are two differences between these:
* {{para|id}} automatically prefixes the link anchor with "Reference-", whereas {{para|ref}} does not
* {{para|id}} automatically prefixes the link anchor with "Reference-", whereas {{para|ref}} does not
* {{para|id}} encloses the link anchor in double quotes, so these must not be provided by the editor; but if using {{para|ref}}, the specified content for this parameter must be enclosed in quotes ''unless'' it consists entirely of letters, figures, hyphens and periods. If it contains ''any'' other character - such as a blank or underscore - it must be quoted. (e.g., a ref anchor of ''Von Autor-2006'' must be specified as {{para|ref|"Von Autor-2006"}})
* {{para|id}} encloses the link anchor in double quotes, so these must not be provided by the editor; but if using {{para|ref}}, the specified content for this parameter must be enclosed in quotes ''unless'' it consists entirely of letters, figures, hyphens and periods. If it contains ''any'' other character - such as a blank or underscore - it must be quoted. (e.g., a ref anchor of ''Von Autor-2006'' must be specified as {{para|ref|"Von Autor-2006"}})
Thus, these two forms
Thus, these two forms
<nowiki>{{wikicite | id = Anchor 1 | reference = Reference text }}</nowiki>
<syntaxhighlight lang="wikitext">{{wikicite | id = Anchor 1 | reference = Reference text }}</syntaxhighlight>
<nowiki>{{wikicite | ref = "Reference-Anchor 1" | reference = Reference text }}</nowiki>
<syntaxhighlight lang="wikitext">{{wikicite | ref = "Reference-Anchor 1" | reference = Reference text }}</syntaxhighlight>
produce identical results.
produce identical results.


Line 36: Line 37:


== References ==
== References ==
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
</nowiki>|
</nowiki>|
According to Atwood, blah blah.<ref>[[#Atwood-2003|Atwood (2003)]], p. 29.</ref>
According to Atwood, blah blah.<ref>[[#Atwood-2003|Atwood (2003)]], p. 29.</ref>
Line 44: Line 45:


{{fake heading|References}}
{{fake heading|References}}
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|<nowiki>
|<nowiki>
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
Line 52: Line 53:


== References ==
== References ==
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
</nowiki>|
</nowiki>|
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
Line 60: Line 61:


{{fake heading|References}}
{{fake heading|References}}
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|<nowiki>
|<nowiki>
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
Line 68: Line 69:


== References ==
== References ==
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
</nowiki>|
</nowiki>|
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
Line 76: Line 77:


{{fake heading|References}}
{{fake heading|References}}
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9. }}
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
}}
}}


Line 109: Line 110:


However this is only one of several ways this particular text could be cited (see [[#Alternatives| § Alternatives]] for more details):
However this is only one of several ways this particular text could be cited (see [[#Alternatives| § Alternatives]] for more details):
*{{tlx|ws}} can take a template as a parameter itself, and then the citation can be linked using the standard <code>ref=harv</code> as described in [[help:CS1]]:
*{{tlx|ws}} can take a template as a parameter itself, and then the citation can be linked using the standard {{tl|harv}}-style footnotes:
:*<code><nowiki>{{ws| {{citation |last=Wellington |first=Duke of |date=19 June 1815 |title=[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']] |ref=harv}} }}</nowiki></code>
:*<code><nowiki>{{ws| {{citation |last=Wellington |first=Duke of |date=19 June 1815 |title=[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']] }} }}</nowiki></code>
:*{{ws| {{citation |last=Wellington |first=Duke of |date=19 June 1815 |title=[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']] |ref=harv}} }}
:*{{ws| {{citation |last=Wellington |first=Duke of |date=19 June 1815 |title=[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']] }} }}
*{{tlx|ws}} can be passed into the template {{tlx|citation}} as part of the title:
:*<code><nowiki>{{citation |last=Wellington |first=Duke of |date=19 June 1815 |title={{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} |ref=harv}}</nowiki></code>
:*{{citation |last=Wellington |first=Duke of |date=19 June 1815 |title={{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} |ref=harv}}


== Features ==
== Features ==
Line 122: Line 120:
* Produces well-formed, accessible, semantically-correct HTML code
* Produces well-formed, accessible, semantically-correct HTML code
* Compatible with many other templates' in-text citation links (any id which starts with "Reference-")
* Compatible with many other templates' in-text citation links (any id which starts with "Reference-")
* Complies with [[WP:AUM]]
* No conditionals
* No conditionals
* No CSS hacks
* No CSS hacks


== Alternatives ==
== Alternatives ==
Note that the identical behavior can be achieved using the more standard {{tl|Harvnb}} (or {{tl|sfn}}) and {{tl|Citation}}
Note that identical behavior can be achieved using the more standard {{tl|Harvnb}} (or {{tl|sfn}}) and {{tl|Citation}}


In article body:
In article body:
Line 133: Line 130:


In references section:
In references section:
<code><nowiki>* {{citation | last = Atwood | first = Margaret | year = 2003 | title = Oryx and Crake | location = Toronto | publisher = McClelland &amp; Stewart | isbn = 978-0-7710-0868-9 }}</nowiki></code>
<code><nowiki>* {{citation | last = Atwood | first = Margaret | year = 2003 | title = Oryx and Crake | location = Toronto | publisher = McClelland & Stewart | isbn = 978-0-7710-0868-9 }}</nowiki></code>


== See also ==
== See also ==
* {{tl|Citation}}
* {{tl|Citation}}
* {{tl|Harvnb}}
* {{tl|Harvnb}}
* {{tl|Sfn}}, an alternative method for creating shortened footnotes.
* {{tl|Sfn}}, an alternative method for creating shortened footnotes
* {{tl|Citeref}}, alternative method to create links to citations
* [[Wikipedia:Citation templates]]
* [[Wikipedia:Citation templates]]
* [[Wikipedia:Citing sources]]
* [[Wikipedia:Citing sources]]
Line 144: Line 142:
* [[T-34#References]], example of usage
* [[T-34#References]], example of usage


<includeonly>
<includeonly>{{Sandbox other||
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Inline templates|{{PAGENAME}}]]
[[Category:Inline templates|{{PAGENAME}}]]
Line 152: Line 150:
[[ja:Template:Wikicite]]
[[ja:Template:Wikicite]]
[[sl:Predloga:Wikisklic]]
[[sl:Predloga:Wikisklic]]
</includeonly>
}}</includeonly>

Latest revision as of 01:23, 19 February 2024

{{Wikicite}} creates an anchor, for use in a "References" section for books, journals, web references, etc. The anchor should be linked-to in the body of the article.

The reference text may be formatted manually, and the template merely adds an anchor for linking from in-text citations. This template is also useful when using a citation template that does not support the |ref= parameter (for example, {{ws}}).

This template is only needed for handwritten citations, or citations using non-standard citation templates, that are linked to by a shortened footnote or a parenthetical reference. If you don't mind using a citation template, it is more standard to use {{sfn}} or {{harv}} with a template such as {{citation}}, {{cite book}}, {{cite web}}, etc.

This template is not necessary if the citation uses a citation template (such as {{cite book}}). Use the |ref= parameter of the citation template to create the anchor. This template is also not necessary if the article does not contain a shortened footnote or parenthetical reference that creates a link (e.g. (Atwood 2003)). The anchor serves no purpose if nothing links to it.

Usage[edit]

Copy-'n'-paste.

{{wikicite | id = | reference = }}

or, alternatively (but not equivalently – see below)

{{wikicite | ref = | reference = }}

The first parameter is an alias for |reference=. The |id= or |ref= parameters are alternative unique identifiers used for the reference link on the page, compatible with some other reference templates. If both |id= and |ref= are provided, |id= is ignored. There are two differences between these:

  • |id= automatically prefixes the link anchor with "Reference-", whereas |ref= does not
  • |id= encloses the link anchor in double quotes, so these must not be provided by the editor; but if using |ref=, the specified content for this parameter must be enclosed in quotes unless it consists entirely of letters, figures, hyphens and periods. If it contains any other character - such as a blank or underscore - it must be quoted. (e.g., a ref anchor of Von Autor-2006 must be specified as |ref="Von Autor-2006")

Thus, these two forms

{{wikicite | id = Anchor 1 | reference = Reference text }}
{{wikicite | ref = "Reference-Anchor 1" | reference = Reference text }}

produce identical results.

The |reference= parameter is the actual reference text. It may be plain text, formatted text, or one of the citation templates.

Examples[edit]

Recommended formats.

Markup Renders as
According to Atwood, blah blah.<ref>[[#Atwood-2003|Atwood (2003)]], p. 29.</ref>

== Notes ==
{{reflist}}

== References ==
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}

According to Atwood, blah blah.[1]

Notes
  1. ^ Atwood (2003), p. 29.
References
  • Atwood, Margaret (2003). Oryx and Crake, Toronto: McClelland & Stewart. ISBN 978-0-7710-0868-9.
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>

== Notes ==
{{reflist}}

== References ==
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}

According to Atwood, blah blah.[1]

Notes
  1. ^ Atwood (2003), p. 29.
References
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}

== Notes ==
{{reflist}}

== References ==
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}

According to Atwood, blah blah.[1]

Notes
  1. ^ Atwood 2003, p. 29.
References

The parameter reference can be assigned templates as well as text. So if there is a template that is used for citations that does not support the usual {{Harvnb}} templates (see Help:CS1 and Help:CS2) the template can be passed into this template via the reference parameter. There is a template called {{ws}} that "places a wikisource icon before text". For example:

{{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} by the [[Duke of Wellington]] (19 June 1815)

would look like:

The Waterloo dispatch. by the Duke of Wellington (19 June 1815)
Markup Renders as
According to the ''[[Duke of Wellington]]'', blah blah.{{sfn|Wellington|1815}}

== Notes ==
{{reflist}}

== References ==
* {{wikicite
   | ref = {{sfnRef|Wellington|1815}}
   | reference ={{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} by the [[Duke of Wellington]] (19 June 1815)
  }}

According to the Duke of Wellington, blah blah.[1]

Notes
References

However this is only one of several ways this particular text could be cited (see § Alternatives for more details):

  • {{ws}} can take a template as a parameter itself, and then the citation can be linked using the standard {{harv}}-style footnotes:
  • {{ws| {{citation |last=Wellington |first=Duke of |date=19 June 1815 |title=[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']] }} }}
  • Wellington, Duke of (19 June 1815), 'The Waterloo dispatch'  .

Features[edit]

  • Compatible with any reference style: editor has 100% control of the format through a technology called editing wikitext

Technical features:

  • Produces well-formed, accessible, semantically-correct HTML code
  • Compatible with many other templates' in-text citation links (any id which starts with "Reference-")
  • No conditionals
  • No CSS hacks

Alternatives[edit]

Note that identical behavior can be achieved using the more standard {{Harvnb}} (or {{sfn}}) and {{Citation}}

In article body: {{Harv|Atwood|2003}}

In references section: * {{citation | last = Atwood | first = Margaret | year = 2003 | title = Oryx and Crake | location = Toronto | publisher = McClelland & Stewart | isbn = 978-0-7710-0868-9 }}

See also[edit]