Template:Ref/doc: Difference between revisions

From FrathWiki
Jump to navigationJump to search
m (1 revision: Current ref/note template system from Wikipedia)
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{documentation subpage}}
'''The ref/note family of templates was imported from [[Wikipedia:Wikipedia|Wikipedia]].'''


==Ref-family templates==
And hence they should probably be edited only by re-importing them.
The {{tl|ref}} family of templates is used to place labeled references and notes and references into an article, with the labels normally being clickable links for navigating from a ref to a corresponding note and back from the note to the ref. The links and backlinks are identified internally by combining the specified parameters. The templates take a variable number of unnamed parameters identified by their position and, optionally, a named parameter named ''noid'' which, if used, should be set by specifying it as "noid=noid".


=== Very simple example ===
== Usage ==
There are many ways to use {{tl|Ref}} and {{tl|Note}}. Among the simplest is:
{| class=wikitable                 
!Article
!Wikitext
|-
|<pre>
Text that requires a footnote.{{Ref|1|1}}


==Notes==
Please see the documentation at [[Wikipedia:Template:Ref]]
:1.{{Note|1}}Body of the footnote.
</pre>
|{{quotation|
Text that requires a footnote.{{Ref|1|1}}


{{Fake heading|Notes}}
=== An example ===
:1.{{Note|1}}Body of the footnote.
Actually an illustration says more than a thousand words.
|}


==== Simple examples ====
This Wikicode:


{{tl|ref}} and {{tl|note}}
<pre>
<nowiki>{{ref|1|2|3|4}}


Example:
{{ref label|1|2|3|4}}
<pre style="border:1; background:white; margin: 0; padding:0; line-height: 130%; word-wrap: break-word;
white-space: -moz-pre-wrap;
white-space:  -o-pre-wrap;
white-space:    -pre-wrap;
white-space:      pre-wrap">
Article text{{ref|reference_name_A|a}} more text{{ref|reference_name_B|b}} more text {{ref|reference_name_C|c|noid=noid}}.
*Bulleted text{{ref|reference_name_B|b|noid=noid}}
*Bulleted text{{ref|reference_name_C|c}}.
*
*intervening text
*
*{{note|reference_name_A|a}}Text for note a.
*{{note|reference_name_B|b}}Text for note b.
*{{note|reference_name_C|c}}Text for note c.
</pre>


This would produce:
{{ref harvard|1|2|3|4}}
<div style="margin: 1em; padding: 1em; border:1px solid #999">
Article text{{ref|reference_name_A|a}} more text{{ref|reference_name_B|b}} more text {{ref|reference_name_C|c|noid=noid}}.
*Bulleted text{{ref|reference_name_B|b|noid=noid}}
*Bulleted text{{ref|reference_name_C|c}}.
*
*intervening text
*
*{{note|reference_name_A|a}}Text for note a.
*{{note|reference_name_B|b}}Text for note b.
*{{note|reference_name_C|c}}Text for note c.
</div>


Notice that the navigation back from the note to the ref does not work for refs which specify "noid=noid". In practice, if "noid=noid" is specified, it is usually specified for all refs having identical unnamed parameters.
{{ref harv|1|2|3|4}}


==== More complex examples ====
{{note|1|2|3|4}}
{{tl|ref label}}, {{tl|ref harv}} and {{tl|ref harvard}}: these all pair with {{tl|note label}}.
These three complex ref family templates display differently but work the same. The {{note label}} template will normally have identical parameters with the ref template with which it is paired, and is normally created by copying the ref, pasting it into the note location, and changing its name to "note label"; this avoids having parameters mismatched because of a typo. Navigation forward uses parameters 1 and 3, navigation backward uses parameters 1 and 2. Parameter 3 is optional, and {{tl|note label}} has an optional fourth parameter.


Example:
{{note label|1|2|3|4|5}}
<pre style="border:1; background:white; margin: 0; padding:0; line-height: 130%; word-wrap: break-word;
</nowiki></pre>
white-space: -moz-pre-wrap;
white-space:  -o-pre-wrap;
white-space:    -pre-wrap;
white-space:      pre-wrap">
Article text{{ref harvard|reference_name_A|a|1}} more text{{ref harvard|reference_name_G|g|}} more text {{ref harv|reference_name_B|b|2}} more text {{ref label|reference_name_C|c|3}} more text {{ref label|reference name_D|d|4}} more text {{ref label|reference name_E|e|none}} more text {{ref label|reference name_F|f|}} more text {{ref label|reference_name_H|h|8}}.
*
*intervening text
*
*{{note label|reference_name_A|a|1}}Text of note for ref a.
*{{note label|reference_name_B|b|2}}Text of note for ref b.
*{{note label|reference_name_C|c|3|ABCDE}}Text of note for ref c.
*{{note label|reference_name_D|d|4|FGHIJ}}Text of note for ref d.
*{{note label|reference_name_E|e|none}}Text of note for ref e.
*{{note label|reference_name_F|f}}Text of note for ref f.
*{{note label|reference_name_G|g|}}{{note label|reference_name_H|h|8}}Text of note for refs g and h.
</pre>


This would produce:
Produces this HTML:
<div style="margin: 1em; padding: 1em; border:1px solid #999">
Article text{{ref harvard|reference_name_A|a|1}} more text{{ref harvard|reference_name_G|g|}} more text {{ref harv|reference_name_B|b|2}} more text {{ref label|reference_name_C|c|3}} more text {{ref label|reference name_D|d|4}} more text {{ref label|reference name_E|e|none}} more text {{ref label|reference name_F|f|}} more text {{ref label|reference_name_H|h|8}}.
*
*intervening text
*
*{{note label|reference_name_A|a|1}}Text of note for ref a.
*{{note label|reference_name_B|b|2}}Text of note for ref b.
*{{note label|reference_name_C|c|3|ABCDE}}Text of note for ref c.
*{{note label|reference_name_D|d|4|FGHIJ}}Text of note for ref d.
*{{note label|reference_name_E|e|none}}Text of note for ref e.
*{{note label|reference_name_F|f}}Text of note for ref f.
*{{note label|reference_name_G|g|}}{{note label|reference_name_H|h|8}}Text of note for refs g and h.
</div>
#This shows the different styles for the ref links; {{tl|ref harvard}} produces a parenthesized link, {{tl|ref harv}} produces a superscripted parenthesized link, and {{tl|ref label}} produces a superscripted link with square brackets.
#The note for ref e has a "^" character as its backlink, because parameter 3 was specified as "none".
#The notes for refs f  and g do not have a clickable backlink, because parameter 3 was not specified.


== Table footnotes ==
    &lt;p&gt;&lt;sup class=&quot;reference plainlinks nourlexpansion&quot; id=&quot;ref_1&quot;&gt;&lt;a href=&quot;#endnote_1&quot; title=&quot;&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
    &lt;p&gt;&lt;span class=&quot;reference&quot;&gt;&lt;sup id=&quot;ref_13&quot;&gt;&lt;a href=&quot;#endnote_13&quot; title=&quot;&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;p&gt;&lt;span class=&quot;reference&quot; id=&quot;ref_13&quot;&gt;&lt;a href=&quot;#endnote_13&quot; title=&quot;&quot;&gt;(2)&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;p&gt;&lt;sup&gt;&lt;span class=&quot;reference&quot; id=&quot;ref_13&quot;&gt;&lt;a href=&quot;#endnote_13&quot; title=&quot;&quot;&gt;(2)&lt;/a&gt;&lt;/span&gt;&lt;/sup&gt;&lt;/p&gt;
    &lt;p&gt;&lt;cite id=&quot;endnote_1&quot; style=&quot;font-style: normal;&quot;&gt;&lt;a href=&quot;#ref_1&quot; title=&quot;&quot;&gt;&lt;b&gt;^2&lt;/b&gt;&lt;/a&gt;&lt;/cite&gt;&amp;nbsp;&lt;/p&gt;
    &lt;p&gt;&lt;cite id=&quot;endnote_13&quot;&gt;&lt;a href=&quot;#ref_13&quot; title=&quot;&quot;&gt;&lt;b&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/b&gt;&lt;/a&gt;&amp;nbsp;4&lt;/cite&gt;&amp;nbsp;&lt;/p&gt;


One common application for {{tl|ref}} and {{tl|notes}} templates is in placing footnotes below tables, as in the following example taken from the [[Kent#Economy]] article:


To allow the preview, <nowiki><ol type="A"></nowiki> is used. to form the needed [[Help:List|list]].
[[Category:Reference—note templates]]
 
{| class="wikitable"
|-
! Year || Regional GVA{{ref label|rounding|A|^}} ||COLSPAN=2| Agriculture ||COLSPAN=2| Industry{{ref label|energy|B|^}} ||COLSPAN=2| Services{{ref label|financial|C|^}}
|-
|COLSPAN=8 | County of Kent (excluding Medway)
|-
| 1995 || '''12,369''' || 379 || 3.1% || 3,886 || 31.4% || 8,104 || 65.5%
|-
| 2000 || '''15,259''' || 259 || 1.7% || 4,601 || 30.2% || 10,399 || 68.1%
|-
| 2003 || '''18,126''' || 287 || 1.6% || 5,057 || 27.9% || 12,783 || 70.5%
|-
|COLSPAN=8 | Medway
|-
| 1995 || '''1,823''' || 21 || 3.1% || 560 || 31.4% || 1,243 || 68.2%
|-
| 2000 || '''2,348''' || 8 || 1.7% || 745 || 30.2% || 1,595 || 67.9%
|-
| 2003 || '''2,671''' || 10 || 1.6% || 802 || 27.9% || 1,859 || 69.6%
|}
<ol type="A">
<li>{{note label|rounding|A|^}} Components may not sum to totals due to rounding
<li>{{note label|energy|B|^}} includes energy and construction
<li>{{note label|financial|C|^}} includes financial intermediation services indirectly measured
</ol>
 
==Alternative referencing style==
 
Using ref/note tags is not the only way to do [[Wikipedia:Footnotes|footnotes]]. Some people prefer to use [[mw:Extension:Cite/Cite.php|Cite.php]]. Cite.php has many advantages, but is not mandatory. You can use the [[User:Cyde/Ref converter|Ref converter]] to replace ref/note tags with the newer [[mw:Extension:Cite/Cite.php|Cite.php]] style. If you are interested in the discussion, please see the [[Wikipedia_talk:Footnotes|Footnotes talk page]]. For details of that system, please see [[Wikipedia:Footnotes]].
 
=== Combining Ref family templates with the alternative referencing style ===
 
An example combining the use of Ref-family templates with the alternative referencing style might be something like
 
<pre style="border:1; background:white; margin: 0; padding:0; line-height: 130%; word-wrap: break-word;
white-space: -moz-pre-wrap;
white-space:  -o-pre-wrap;
white-space:    -pre-wrap;
white-space:      pre-wrap">
Yammer yammer yammer.<ref name=smith2000>Smith wrote the definitive book on yammering.{{ref|Smith2000|Smith 2000}}
</ref>Yammer yammer yammer.<ref name=smith2000/>
...
==References==
<References/>
...
==Bibliography==
*{{note|Smith2000}}, Smith 2000, "A book about yammering".
</pre>
 
which could produce something like:
:Yammer yammer yammer.<ref name=smith2000>Smith wrote the definitive book on yammering.{{ref|Smith2000|Smith 2000}}</ref>Yammer yammer yammer.<ref name=smith2000/>
:...
:==References==
:<References/>
:...
:==Bibliography==
:*{{note|Smith2000}}, Smith 2000, "A book about yammering".
 
Also see examples and explanation in [[Wikipedia:Footnote3]].
 
==Third party tool==
A third-party tool to translate articles using the templates described on this page into the Cite.php system is available, see ''[[User:Cyde/Ref converter|Ref converter]]''.
 
== See also ==
* [[Wikipedia:Footnotes]] &mdash; Discussion about this reference method
* [[Wikipedia:Template messages/Sources of articles]]
* [[Template:Ref]] &mdash; Template for references using this method
* [[Template:Ref label]] &mdash; Same as {{tl|Ref}}, but with more features
* [[Template:Footnote label]] &mdash; Same as, and redirect to, {{tl|Ref label}}, but ignored by bots that convert {{tl|Ref label}} and {{tl|Ref}} to [[WP:FN|Cite.php]] references; for use of these templates for informational footnotes as opposed to reference citations
* [[Template:Note]] &mdash; Template for footnotes using this method
* [[Template:Note label]] &mdash; Same as Note, but with more features
* [[:Category:Citation templates]] &mdash; More citation templates, some of which are not part of the Ref/Note Label system
 
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Citation templates|{{PAGENAME}}]]
[[Category:Inline templates|{{PAGENAME}}]]
 
{{#switch:{{FULLPAGENAME}}
  |Template:Ref=
<!-- ADD INTERWIKIS FOR [[Template:Ref]] BELOW THIS LINE -->
[[ar:قالب:Ref]]
[[bg:Шаблон:Справка]]
[[bs:Šablon:Ref]]
[[ca:Plantilla:Ref]]
[[cs:Šablona:Ref]]
[[da:Skabelon:Ref]]
[[de:Vorlage:Ref]]
[[el:Πρότυπο:Ref]]
[[es:Plantilla:Ref]]
[[fa:الگو:Ref]]
[[fr:Modèle:Ref label]]
[[hr:Predložak:Ref]]
[[hu:Sablon:Hiv]]
[[id:Templat:Ref]]
[[is:Snið:Ref]]
[[it:Template:Ref]]
[[ja:Template:Ref]]
[[ko:틀:Ref]]
[[nl:Sjabloon:Ref]]
[[no:Mal:Ref]]
[[no:Mal:Ref]]
[[pl:Szablon:Ref]]
[[pt:Predefinição:Ref]]
[[ro:Format:Ref]]
[[ru:Шаблон:Ref]]
[[simple:Template:Ref]]
[[sk:Šablóna:Ref]]
[[sl:Predloga:Ref]]
[[sl:Predloga:Ref]]
[[sr:Шаблон:Ref]]
[[sv:Mall:ref]]
[[tr:Şablon:Ref]]
[[uk:Шаблон:Ref]]
[[zh:Template:Ref]]
 
  |Template:Ref label=
<!-- ADD INTERWIKIS FOR [[Template:Ref label]] BELOW THIS LINE -->
[[hr:Predložak:Ref label]]
[[sl:Predloga:Oznaka ref]]
[[ja:Template:Ref label]]
  |Template:Ref harvard=
<!-- ADD INTERWIKIS FOR [[Template:Ref harvard]] BELOW THIS LINE -->
 
  |Template:Note=
<!-- ADD INTERWIKIS FOR [[Template:Note]] BELOW THIS LINE -->
[[sl:Predloga:Opomba]]
[[sv:Mall:not]]
 
  |Template:Note label=
<!-- ADD INTERWIKIS FOR [[Template:Note label]] BELOW THIS LINE -->
[[ar:قالب:عنوان ملاحظة]]
[[es:Plantilla:Note label]]
[[eo:Ŝablono:Markita noto]]
[[ko:틀:Note label]]
[[hr:Predložak:Note label]]
[[ja:Template:Note label]]
[[pt:Predefinição:Note label]]
[[sl:Predloga:Oznaka opombe]]
}}</includeonly>

Latest revision as of 09:12, 18 November 2009

The ref/note family of templates was imported from Wikipedia.

And hence they should probably be edited only by re-importing them.

Usage

Please see the documentation at Wikipedia:Template:Ref

An example

Actually an illustration says more than a thousand words.

This Wikicode:

{{ref|1|2|3|4}}

{{ref label|1|2|3|4}}

{{ref harvard|1|2|3|4}}

{{ref harv|1|2|3|4}}

{{note|1|2|3|4}}

{{note label|1|2|3|4|5}}

Produces this HTML:

   <p><sup class="reference plainlinks nourlexpansion" id="ref_1"><a href="#endnote_1" title="">2</a></sup></p>
   <p><span class="reference"><sup id="ref_13"><a href="#endnote_13" title="">[2]</a></sup></span></p>
   <p><span class="reference" id="ref_13"><a href="#endnote_13" title="">(2)</a></span></p>
   <p><sup><span class="reference" id="ref_13"><a href="#endnote_13" title="">(2)</a></span></sup></p>
   <p><cite id="endnote_1" style="font-style: normal;"><a href="#ref_1" title=""><b>^2</b></a></cite>&nbsp;</p>
   <p><cite id="endnote_13"><a href="#ref_13" title=""><b><sup>3</sup></b></a>&nbsp;4</cite>&nbsp;</p>