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

Template:Wikicite/doc: Difference between revisions

Content deleted Content added
show difference early on, and mention |reference=
-
 
(45 intermediate revisions by 23 users not shown)
Line 1:
{{Documentation subpage}}
{{High-use}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{Uses TemplateStyles|Template:Citation/styles.css}}
 
{{tl|Wikicite}} makescreates aan simple referenceanchor, for use in a "References" section for books, journals, web references, etc. The referenceanchor textshould isbe formattedlinked-to manually, andin the templatebody merelyof addsthe anarticle. anchor for linking from in-text citations.
 
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}}).
Cut-'n'-paste:
 
'''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.
<nowiki>{{Wikicite | id= | reference= }}</nowiki>
or, alternatively
<nowiki>{{Wikicite | ref= | reference= }}</nowiki>
 
This template is ''not'' necessary if the citation uses a citation template (such as {{tl|cite book}}). Use the {{para|ref}} parameter of the citation template to create the anchor. This template is also ''not'' necessary if the article does not contain a [[WP:CITESHORT|shortened footnote]] or [[WP:Parenthetical references|parenthetical reference]] that creates a link (e.g. {{Harv|Atwood|2003}}). The anchor serves no purpose if nothing links to it.
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
== Usage ==
*{{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"}})
Copy-'n'-paste.
<syntaxhighlight lang="wikitext">{{wikicite | id = | reference = }}</syntaxhighlight>
or, alternatively (but not equivalently{{snd}}see below)
<syntaxhighlight lang="wikitext">{{wikicite | ref = | reference = }}</syntaxhighlight>
 
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}} 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
<nowikisyntaxhighlight lang="wikitext">{{Wikicitewikicite | id = Anchor 1 | reference = Reference text }}</nowikisyntaxhighlight>
<nowikisyntaxhighlight lang="wikitext">{{Wikicitewikicite | ref = "Reference-Anchor 1" | reference = Reference text }}</nowikisyntaxhighlight>
produce identical results.
 
The {{para|reference}} parameter is the actual reference text. It may be plain text, formatted text, or one of the citation templates.
 
== Examples ==
Recommended formats.
Recommended format (using the {{para|id}} parameter for illustration):
 
{{markup|<nowiki>
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}}. }}
</nowiki>|
According to Atwood, blah blah.<ref>[[#Atwood-2003|Atwood (2003)]], p. 29.</ref>
 
{{fake heading|Notes}}
{{reflist|close=1}}
 
{{fake heading|References}}
* {{wikicite | ref = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|<nowiki>
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}}. }}
</nowiki>|
According to Atwood, blah blah.<ref>[[#Reference-Atwood-2003|Atwood (2003)]], p. 29.</ref>
 
{{fake heading|Notes}}
{{reflist|close=1}}
 
{{fake heading|References}}
* {{wikicite | id = Atwood-2003 | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|<nowiki>
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
 
== Notes ==
<nowiki>* {{Wikicite | id= Atwood-2003 | reference= Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 0-7710-0868-6. }}</nowiki>
{{reflist}}
 
== References ==
Result:
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
</nowiki>|
According to Atwood, blah blah.{{sfn|Atwood|2003|p=29}}
 
{{fake heading|Notes}}
* {{Wikicite | id= Atwood-2003 | reference= Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 0-7710-0868-6. }}
{{reflist|close=1}}
 
{{fake heading|References}}
Resulting code:
* {{wikicite | ref = {{sfnRef|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
}}
 
The parameter <code>reference</code> 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 {{tl|Harvnb}} templates (see [[Help:CS1]] and [[Help:CS2]]) the template can be passed into this template via the <code>reference</code> parameter. There is a template called {{tlx|ws}} that "places a wikisource icon before text". For example:
<nowiki><li><span class="citation wikicite" id="Reference-Atwood-2003">Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. <a href="/w/index.php?title=Special:Booksources&amp;isbn=0771008686" class="internal">ISBN 0-7710-0868-6</a>.</span></li></nowiki>
:<code><nowiki>{{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} by the [[Duke of Wellington]] (19 June 1815)</nowiki></code>
would look like:
:{{ws|[[s:Wellingon's Waterloo dispatch to Lord Bathurst, 19 June 1815|''The Waterloo dispatch'']]}} by the [[Duke of Wellington]] (19 June 1815)
 
{{markup|<nowiki>
This includes the HTML <code><nowiki><span class="citation wikicite" id="Reference-Atwood-2003"></nowiki></code>, allowing you to link to the citation in your article's text with, for example
According to the ''[[Duke of Wellington]]'', blah blah.{{sfn|Wellington|1815}}
<code><nowiki>[[#Reference-Atwood-2003 |(Atwood 2003)]]</nowiki></code>, yielding a Harvard-style reference [[#Reference-Atwood-2003|(Atwood 2003)]].
 
== Notes ==
This is typically linked to in the article body from a [[WP:CITESHORT|shortened footnote]] in this form:
{{reflist}}
<nowiki><ref>[[#Reference-Atwood-2003| Atwood (2003)]]</ref></nowiki>
 
== References ==
This can be linked from {{tl|Harv}} family templates if the {{para|ref}} parameter is used in combination with the {{tl|Harvid}} template, as in the following example:
* {{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)
}}
</nowiki>|
According to the ''[[Duke of Wellington]]'', blah blah.{{sfn|Wellington|1815}}
 
{{fake heading|Notes}}
<nowiki>* {{Wikicite | ref= {{Harvid|Atwood|2003}} | reference= Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. ISBN 0-7710-0868-6. }}</nowiki>
{{reflist|close=1}}
 
{{fake heading|References}}
Resulting code:
* {{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)
}}
}}
 
However this is only one of several ways this particular text could be cited (see [[#Alternatives| § Alternatives]] for more details):
<nowiki><li><span class="citation wikicite" id="CITEREFAtwood2003">Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. <a href="/w/index.php?title=Special:Booksources&amp;isbn=0771008686" class="internal">ISBN 0-7710-0868-6</a>.</span></li></nowiki>
*{{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'']] }} }}</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'']] }} }}
 
== Features ==
Line 52 ⟶ 119:
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-")
* Complies with [[WP:AUM]]
* No conditionals
* No CSS hacks
 
== Alternatives ==
Note that the identical behavior can be achieved using the more standard {{tl|Harvnb}} (or {{tl|sfn}}) and {{tl|Citation}}.
 
In article body:
Line 64 ⟶ 130:
 
In references section:
<code><nowiki>* {{Citationcitation | last = Atwood | first = Margaret | year = 2003 | title = Oryx and Crake | location = Toronto | publisher = McClelland &amp; Stewart | isbn =0771008686 978-0-7710-0868-9 }}</nowiki></code>
 
== See also ==
* {{tl|Citation}}
* {{tl|Harvnb}}
* {{tl|Sfn}}, an alternative method for creating shortened footnotes.
* {{tl|Citeref}}, alternative method to create links to citations
* [[Wikipedia:Citation templates]]
* [[Wikipedia:Citing sources]]
* [[Wikipedia:Citing sources/exampleFurther styleconsiderations#Using Wikicite]]
* [[T-34#References]], example of useusage
 
<includeonly>{{Sandbox other||
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Inline templates|{{PAGENAME}}]]
[[Category:Citation templates|{{PAGENAME}}]]
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[ja:Template:Wikicite]]
[[sl:Predloga:Wikisklic]]
</includeonly>
}}</includeonly>