Template:R/testcases
| This is the template test cases page for the sandbox of Template:R. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
| Usage | Display | Notes |
|---|---|---|
{{R/sandbox|SandboxRefName}} |
Text.[1] | Equivalent to <ref name="SandboxRefName" />. |
{{R/sandbox|SandboxRefName|p=100}}
|
Text.[1]: 100
Text.[1]: 100 Text.[1]: 100, 102 Text.[1]: 100, 102 |
Adds a page number (or other location identifier) within the source.
Use If the article cites only one location in a given source, reduce clutter by coding simply |
{{R/sandbox|SandboxRefName|pages=10–14}}(endash)
|
Text.[1]: 10–14
Text.[1]: 10–14 Text.[1]: 2-14–2-16 Text.[1]: 2-14–2-16 Text.[1]: 2-14, 2-16 Text.[1]: 3, 6 Text.[1]: §C Text.[1]: Dust jacket Text.[1]: para. 7 | |
{{R/sandbox|SandboxRefName|Bam|Bar}} |
Text.[1][2][3] | Equivalent to {{R/sandbox|SandboxRefName}}{{R/sandbox|Bam}}{{R/sandbox|Bar}}or <ref name=SandboxRefName/><ref name=Bam/><ref name=Bar/>.
Up to nine references may be "bundled" this way. |
{{R/sandbox|1=SandboxRefName|2=Bam|3=Bar|4=Bas|p1=100|pp2=10–14|at4=§C}}
|
Text.[1]: 100 [2]: 10–14 [3][4]: §C | Equivalent to {{R/sandbox|SandboxRefName|p=100}}{{R/sandbox|Bam|pp=10–14}}{{R/sandbox|Bar}}{{R/sandbox|Bas|at=§C}}.
In the example, not all references have pages; make sure that e.g. |
{{R/sandbox|group=Notes|NtName}}
|
Text.[Notes 1]
Text.[Notes 1]: 13 |
The |group=, |grp=, and |g= parameters are equivalent and echo <ref group=Notes name=NtName/>.
If present, the parameter applies to all references in the template. |
{{R/sandbox|SandboxRefName|p=100|q=quote from the text}}
|
Text.[1]: 100
Text cited to a range of pages with a quote from a specific page.[1]: 100–102 Text with a foreign-language quote supporting it.[1]: 101 Text with a foreign-language quote and translation supporting it.[1]: 123 |
Makes sense only if |p= (or one of its synonyms) is present. |quote= (or |q=) underlines the superscript page number/|quote-page= or |quote-pages= can be used to optionally specify a specific page or number of pages for the quote only. If this number is the same as what's defined through |p= or |pp=, the special symbolic tokens "p" and "pp" can be used instead of an actual page number. Curved quotes are disfavored by MOS:STRAIGHT. |
{{R/sandbox|1=SandboxRefName|2=Bam|3=Bar|4=Bas|p1=100|pp2=10–14|at4=§C|q1=Quote from 100|q4=Quote from §C}}
|
Text.[1]: 100 [2]: 10–14 [3][4]: §C | In the example, not all references have quotes; make sure that e.g. |1= and |p1= and |q1= all match. |
{{R/sandbox |n=SandboxRefName2 |p=201 |r=Harold Smith (1989). ''Proper Referencing''. Atlanta Press. p. 105, 201.}}
|
More[5]: 201 [6]: 321 good[6]: 356 prose.[Notes 3] | Examples of inline definitions and nested footnotes. |
{{R/sandbox |n=SandboxRefName4 |r=Citation A.}}
|
Two[7] citations[7][7] bundled into one entry, or one citation[8] with accumulated[8][8]: 102 commentary[8][8]: 342 [8][8]: 346 from shortened references. | Examples of annotation. If the annotation should be the page number defined through |p= or what would be shown as quote in the tooltip, the special symbolic tokens "p" and "q" can be used with |annotation= in order to avoid having to repeat this contents. |
{{R/sandbox |n=SandboxRefName6 |r=Citation D.}}
|
A citation[9] with accumulated[9][9]: 102 commentary[9][9]: 342 [9][9]: 346 using indentation in reference section and tooltip view. | Indentation in annotations. It can be achieved by adding : colons. If it is using for the quote parameter |q=, it can be achieved by using |leadin=. |
{{R/sandbox |n=SandboxRefName7 |r=Citation E. |s=Context7}}
|
Context sections of the article supported by the reference can be defined through {{section}} (or other means, see: LST). The three parts of section "Context7" in this example[10] are shown underlined for illustration purposes.[10][10]: 10 | {{R}} will display its "context" as "dotted underline" tooltip (to be distinguished from the "dashed underline" tooltip further up) when hovering the mouse over the reference link. Multiple sections of the same name will be shown merged (without separator, hence include some delimiter like space into the sections). Note the special syntax used to define sections (with empty |begin= and |end= attributes). Keep the size of the selected sections reasonably short and do not forget to define the end of a section. When no name was specified, names are build following this scheme for context sections: "cite_sect-group-name-pagelocation" (where group, name, page (either page or pages) and location refer to the corresponding template parameters and can be empty if omitted). |
| Usage | Display | Notes |
|---|---|---|
{{r|RefName}} |
Text.[11] | Equivalent to <ref name="RefName" />. |
{{r|RefName|p=100}}
|
Text.[11]: 100
Text.[11]: 100 Text.[11]: 100, 102 Text.[11]: 100, 102 |
Adds a page number (or other location identifier) within the source.
Use If the article cites only one location in a given source, reduce clutter by coding simply |
{{r|RefName|pages=10–14}}(endash)
|
Text.[11]: 10–14
Text.[11]: 10–14 Text.[11]: 2-14–2-16 Text.[11]: 2-14–2-16 Text.[11]: 2-14, 2-16 Text.[11]: 3, 6 Text.[11]: §C Text.[11]: Dust jacket Text.[11]: para. 7 | |
{{r|RefName|Bam|Bar}} |
Text.[11][2][3] | Equivalent to {{r|RefName}}{{r|Bam}}{{r|Bar}}or <ref name=RefName/><ref name=Bam/><ref name=Bar/>.
Up to nine references may be "bundled" this way. |
{{r|1=RefName|2=Bam|3=Bar|4=Bas|p1=100|pp2=10–14|at4=§C}}
|
Text.[11]: 100 [2]: 10–14 [3][4]: §C | Equivalent to {{r|RefName|p=100}}{{r|Bam|pp=10–14}}{{r|Bar}}{{r|Bas|at=§C}}.
In the example, not all references have pages; make sure that e.g. |
{{r|group=Notes|NtName}}
|
Text.[Notes 1]
Text.[Notes 1]: 13 |
The |group=, |grp=, and |g= parameters are equivalent and echo <ref group=Notes name=NtName/>.
If present, the parameter applies to all references in the template. |
{{r|RefName|p=100|q=quote from the text}}
|
Text.[11]: 100
Text cited to a range of pages with a quote from a specific page.[11]: 100–102 Text with a foreign-language quote supporting it.[11]: 101 Text with a foreign-language quote and translation supporting it.[11]: 123 |
Makes sense only if |p= (or one of its synonyms) is present. |quote= (or |q=) underlines the superscript page number/|quote-page= or |quote-pages= can be used to optionally specify a specific page or number of pages for the quote only. If this number is the same as what's defined through |p= or |pp=, the special symbolic tokens "p" and "pp" can be used instead of an actual page number. Curved quotes are disfavored by MOS:STRAIGHT. |
{{r|1=RefName|2=Bam|3=Bar|4=Bas|p1=100|pp2=10–14|at4=§C|q1=Quote from 100|q4=Quote from §C}}
|
Text.[11]: 100 [2]: 10–14 [3][4]: §C | In the example, not all references have quotes; make sure that e.g. |1= and |p1= and |q1= all match. |
{{r |n=RefName2 |p=201 |r=Harold Smith (1989). ''Proper Referencing''. Atlanta Press. p. 105, 201.}}
|
More[12]: 201 [13]: 321 good[13]: 356 prose.[Notes 4] | Examples of inline definitions and nested footnotes. |
{{r |n=RefName4 |r=Citation A.}}
|
Two[14] citations[14][14] bundled into one entry, or one citation[15] with accumulated[15][15]: 102 commentary[15][15]: 342 [15][15]: 346 from shortened references. | Examples of annotation. If the annotation should be the page number defined through |p= or what would be shown as quote in the tooltip, the special symbolic tokens "p" and "q" can be used with |annotation= in order to avoid having to repeat this contents. |
{{r |n=RefName6 |r=Citation D.}}
|
A citation[16] with accumulated[16][16]: 102 commentary[16][16]: 342 [16][16]: 346 using indentation in reference section and tooltip view. | Indentation in annotations. It can be achieved by adding : colons. If it is using for the quote parameter |q=, it can be achieved by using |leadin=. |
{{r |n=RefName7 |r=Citation E. |s=Context7}}
|
Context sections of the article supported by the reference can be defined through {{section}} (or other means, see: LST). The three parts of section "Context7" in this example[17] are shown underlined for illustration purposes.[17][17]: 10 | {{R}} will display its "context" as "dotted underline" tooltip (to be distinguished from the "dashed underline" tooltip further up) when hovering the mouse over the reference link. Multiple sections of the same name will be shown merged (without separator, hence include some delimiter like space into the sections). Note the special syntax used to define sections (with empty |begin= and |end= attributes). Keep the size of the selected sections reasonably short and do not forget to define the end of a section. When no name was specified, names are build following this scheme for context sections: "cite_sect-group-name-pagelocation" (where group, name, page (either page or pages) and location refer to the corresponding template parameters and can be empty if omitted). |
Test cases using testcase template
[edit]{{R|Rashke|p=[[Category:Templates needing substitution checking]]<sup class="noprint Inline-Template " style="white-space:nowrap;">&#91;<i>[[Wikipedia:Citing sources|<span title="This citation requires a reference to the specific page or range of pages in which the material appears.&#32;(February 2012)">page&nbsp;needed</span>]]</i>&#93;</sup>}}→ [18]: [page needed]{{R/sandbox|Rashke|p=[[Category:Templates needing substitution checking]]<sup class="noprint Inline-Template " style="white-space:nowrap;">&#91;<i>[[Wikipedia:Citing sources|<span title="This citation requires a reference to the specific page or range of pages in which the material appears.&#32;(February 2012)">page&nbsp;needed</span>]]</i>&#93;</sup>}}→ [18]: [page needed]
References
[edit]References
[edit]- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Sandbox Reference text.
- 1 2 3 4 5 6 Bam reference text.
- 1 2 3 4 5 6 Bar reference text.
- 1 2 3 4 Bas reference text.
- 1 2 Harold Smith (1989). Proper Referencing. Atlanta Press. pp. 105, 201.
- 1 2 Smith, Harold (2020). Proper Referencing (2nd ed.). Atlanta Press. pp. 321, 356.
- 1 2 Citation A. Citation B.
- 1 2 3 4 Citation C. Note for page 102. Note for page 342. 346:
Quote from page 346
- 1 2 3 4 Citation D.
- p. 102: Note for page 102.
- p. 342: Note for page 342.
Quote from page 346
- 1 2 Citation E. :
Quote E
- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Reference text.
- 1 2 Harold Smith (1989). Proper Referencing. Atlanta Press. pp. 105, 201.
- 1 2 Smith, Harold (2020). Proper Referencing (2nd ed.). Atlanta Press. pp. 321, 356.
- 1 2 Citation A. Citation B.
- 1 2 3 4 Citation C. Note for page 102. Note for page 342. 346:
Quote from page 346
- 1 2 3 4 Citation D.
- p. 102: Note for page 102.
- p. 342: Note for page 342.
- p. 346:
Quote from page 346
- 1 2 Citation E.
Quote E
- 1 2 Cite error: The named reference
Rashkewas invoked but never defined (see the help page).