Difference between revisions of "Template:Reflist/doc"
Thadius856 (talk | contribs) (Creation) |
Thadius856 (talk | contribs) (Creation) |
||
Line 1: | Line 1: | ||
This [[Wikipedia:Citation templates|citation template]] provides formatting and organizational features for [[Wikipedia:Help:Footnotes|footnotes]]. It encapsulates the <references> tag used by the <code>cite.php</code> MediaWiki extension to show the list of references as defined by <ref> tags. It adds support for sizing the column width, groups and list-defined references. | |||
== | ==Parameters== | ||
There are no ''required'' parameters; if none are supplied, a single-column list will be generated if there are fewer than 10 references in the list. If you have more than 10 references, it will use columns of 30em wide if your device allows this. | |||
.references | |||
Optional parameters are: | |||
* Unnamed parameter (must be the first one if used): the minimum width for each column of references, typically in [[Wikipedia:em (typography)#CSS|em]]s. Syntax (for example) {{t|reflist|30em}} with no space (i.e. not {{t|reflist|30 em}}). Note that this replaces '''colwidth'''—see Obsolete parameters section. | |||
* '''refs''': used with list-defined references. | |||
* '''group''': identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g., {{t|Reflist|2=group=groupname}} renders all references with ''groupname'' as the group name. There are five pre-defined group names that style the list differently. See [[#Grouped references|§ Grouped references]] below. | |||
* '''liststyle''': specifies the style used when the reference list is rendered. The default is a numbered list. When set, it will override the style set by the <code>group</code> parameter, without affecting group functionality. See [[#List styles|§ List styles]] below. | |||
== | ==Usage== | ||
{{markup|title=Using only footnote-style references | |||
|<nowiki>Lorem ipsum.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
==References== | |||
{{Reflist}}</nowiki> | |||
|Lorem ipsum.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
= | {{fake heading|sub=3|References}} | ||
{{Reflist}} | |||
}} | |||
{{ | ===Columns=== | ||
{{t|Reflist|30em}} (for example) instructs the browser to create as many columns as possible (of width at least 30 [[Wikipedia:Em (typography)|em]], in this example) given the width of the display window. ([http://www.w3.org/TR/CSS21/syndata.html#length-units Units supported are em, ex, in, cm, mm, pt, pc, px], but em is almost always used.) There must not be a space between the number and the unit. Percent is not supported. | |||
====Example==== | |||
{{markup|title=15em wide columns (vary width of display window to see change in number of columns) | |||
|<nowiki>Lorem ipsum.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
== | ==References== | ||
*[[ | {{Reflist|15em}}</nowiki> | ||
[[ | |Lorem ipsum.<ref>Source name, access date, etc.</ref> | ||
< | Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | ||
[[Category: | Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | ||
</ | Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | ||
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> | |||
{{fake heading|sub=3|References}} | |||
{{Reflist|15em}}<!-- note 15em used here for illustration purposes because larger value won't columnize in the "renders as" part on many screens --> | |||
}} | |||
The syntax {{tlx|Reflist|2}} (for example), which specifies two columns of equal width ''regardless of the available display width'', is deprecated. When you use 1 the template gives you a single column while 2 will pretend you specified 30em. When using higher column counts, it will pretend you specified 25em. | |||
==Technical details== | |||
===Font size=== | |||
The font size should reduce to 90% for most browsers, but may appear to show at 100% for Internet Explorer and possibly other browsers.<ref group="general" name="fontsize" /> As of December 21, 2010, the standard <references> tag has the same font styling. The smaller font may be disabled through. | |||
===Browser support for columns=== | |||
Multiple columns are generated by using [[Wikipedia:Cascading Style Sheets|CSS3]], which is still in development; thus only browsers that properly support the multi-column property will show multiple columns with {{tl|Reflist}}. | |||
These browsers '''support''' CSS3 columns: | |||
* [[Wikipedia:Gecko (software)|Gecko]]-based browsers such as [[Wikipedia:Mozilla Firefox]] | |||
* [[Wikipedia:WebKit]]-based browsers such as [[Wikipedia:Safari (web browser)|Safari]] and [[Wikipedia:Google Chrome]] | |||
* [[Wikipedia:Opera (web browser)|Opera]] from version 11.10 onward | |||
* [[Wikipedia:Internet Explorer]] from version 10 onward | |||
These browsers do '''not support''' CSS3 columns: | |||
* Microsoft [[Wikipedia:MSHTML]]-based browsers including Internet Explorer up to version 9<ref group="general" name="msdn" /> | |||
* [[Wikipedia:Opera (web browser)|Opera]] through to version 11 | |||
==Obsolete parameters== | |||
These parameters are no longer in use: | |||
* '''colwidth''': Same as specifying a column-width for the first unnamed parameter. Replaced by width as unnamed first parameter. | |||
==Limitations== | |||
Do not use {{tl|Reflist}} or other templates or modules that use <:references> in numbered or unnumbered lists if the list is inside an [[Wikipedia:Span and div|HTML div tag]]. | |||
<includeonly> | |||
[[Category:Footnote templates]] | |||
[[Category:Reference list templates]] | |||
</includeonly> |
Latest revision as of 10:08, 22 January 2022
This citation template provides formatting and organizational features for footnotes. It encapsulates the <references> tag used by the cite.php
MediaWiki extension to show the list of references as defined by <ref> tags. It adds support for sizing the column width, groups and list-defined references.
Parameters
There are no required parameters; if none are supplied, a single-column list will be generated if there are fewer than 10 references in the list. If you have more than 10 references, it will use columns of 30em wide if your device allows this.
Optional parameters are:
- Unnamed parameter (must be the first one if used): the minimum width for each column of references, typically in ems. Syntax (for example) {{reflist|30em}} with no space (i.e. not {{reflist|30 em}}). Note that this replaces colwidth—see Obsolete parameters section.
- refs: used with list-defined references.
- group: identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g., {{Reflist|group=groupname}} renders all references with groupname as the group name. There are five pre-defined group names that style the list differently. See § below.
- liststyle: specifies the style used when the reference list is rendered. The default is a numbered list. When set, it will override the style set by the
group
parameter, without affecting group functionality. See § below.
Usage
Markup | Renders as |
---|---|
Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist}} |
|
Columns
{{Reflist|30em}} (for example) instructs the browser to create as many columns as possible (of width at least 30 em, in this example) given the width of the display window. (Units supported are em, ex, in, cm, mm, pt, pc, px, but em is almost always used.) There must not be a space between the number and the unit. Percent is not supported.
Example
Markup | Renders as |
---|---|
Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist|15em}} |
|
The syntax {{Reflist|2}}
(for example), which specifies two columns of equal width regardless of the available display width, is deprecated. When you use 1 the template gives you a single column while 2 will pretend you specified 30em. When using higher column counts, it will pretend you specified 25em.
Technical details
Font size
The font size should reduce to 90% for most browsers, but may appear to show at 100% for Internet Explorer and possibly other browsers.[general 1] As of December 21, 2010, the standard <references> tag has the same font styling. The smaller font may be disabled through.
Browser support for columns
Multiple columns are generated by using CSS3, which is still in development; thus only browsers that properly support the multi-column property will show multiple columns with {{Reflist}}.
These browsers support CSS3 columns:
- Gecko-based browsers such as Wikipedia:Mozilla Firefox
- Wikipedia:WebKit-based browsers such as Safari and Wikipedia:Google Chrome
- Opera from version 11.10 onward
- Wikipedia:Internet Explorer from version 10 onward
These browsers do not support CSS3 columns:
- Microsoft Wikipedia:MSHTML-based browsers including Internet Explorer up to version 9[general 2]
- Opera through to version 11
Obsolete parameters
These parameters are no longer in use:
- colwidth: Same as specifying a column-width for the first unnamed parameter. Replaced by width as unnamed first parameter.
Limitations
Do not use {{Reflist}} or other templates or modules that use <:references> in numbered or unnumbered lists if the list is inside an HTML div tag.
Cite error: <ref>
tags exist for a group named "general", but no corresponding <references group="general"/>
tag was found