Changes
Jump to navigation
Jump to search
m
change source to syntaxhighlight
{{Wikipedia how to|H:CL}}
{{notice|This help page is mainly of technical interest to those who are creating new label styles. For the use of defined styles, refer to [[WP:CITELABEL]].}}
When automated [[Help:Footnotes|footnotes]] are used on Wikipedia pages, the default form of the footnote labels is {{dummy ref|1}}, {{dummy ref|2}}, {{dummy ref|3}}, etc. When [[WP:REFGROUP|grouped footnotes]] are used, the labels are {{dummy ref|''name'' 1}}, {{dummy ref|''name'' 2}}, etc., where ''name'' is the name given to the group. However, by using certain reserved group names, it is possible to make the labels appear in a different form, such as {{dummy ref|i}}, {{dummy ref|ii}}, etc. or {{dummy ref|a}}, {{dummy ref|b}}, etc.
Currently existing reserved group names are:
{{Cite link label styles}}
For example, a footnote which is to appear in the i, ii, iii... group can be written as:
* {{tag|ref|params=group=lower-roman}}
To generate the list of the footnotes in that group, use for example
* {{tlx|reflist|2=group=lower-roman}}
Further examples, technical information and instructions for creating new reserved groups can be found below.
==Technical==
Version [[rev:66749|r66749]] of the {{Cite.php}} extension implements the ability to create styles for the cite link labels. Although the ability to create in-text cite label styles is unlimited, the matching reference list label styles are currently limited to those supported by the CSS {{code|list-style-type}} property and to browser support.
==Numeric labels==
The default in-text cite links and reference list backlinks use numeric labels automatically generated by the software. The labels are linked to provide a connection between the in-text cite and the reference list cite.
In this example, the super-scripted, in-text cites use a numeric label that matches the citation in the reference list:
{{markup
|<nowiki>The Sun is pretty big,<ref group="test">Miller, E: ''The Sun'', page 23. Academic Press, 2005.</ref>
but the Moon is not so big.<ref group="test">Brown, R: "Size of the Moon", ''Scientific American'', 51(78):46</ref>
The Sun is also quite hot.<ref group="test">Miller, E: ''The Sun'', page 34. Academic Press, 2005.</ref>
==References==
<references />
</nowiki>
|The Sun is pretty big,<ref group="test">Miller, E: ''The Sun'', page 23. Academic Press, 2005.</ref>
but the Moon is not so big.<ref group="test">Brown, R: "Size of the Moon", ''Scientific American'', 51(78):46</ref>
The Sun is also quite hot.<ref group="test">Miller, E: ''The Sun'', page 34. Academic Press, 2005.</ref>
{{fake heading|sub=3|References}}
{{reflist|group="test"|close}}}}
==Cite link sequence styles==
Special group names have been defined which give alternative sequences, such as alphabetical and roman numerals, instead of Arabic numerals.
===List of custom link label sequences===
{{Cite link label styles|interface=y}}
The list below is created automatically by [[Special:PrefixIndex]]:
<div>{{Special:PrefixIndex/MediaWiki:cite_link_label_group-}}</div>
===Markup restriction===
These sequences will only work properly when using the {{tl|Reflist}} template. Although the {{tag|references|s}} tag supports the {{code|1=group=}} attribute, the footnotes will be displayed with the default Arabic numerals.
===Creating cite label sequence styles===
Only admins can perform these actions. Non-admins may request additions on the talk page.
Currently, only styles supported by the CSS {{code|list-style-type}} element may be added.<ref>{{cite web |title=CSS list-style-type Property |work=w3schools.com |url=http://www.w3schools.com/css/pr_list-style-type.asp}}</ref> Not all styles are supported by all browsers— see the list below.<ref>{{cite web |title=List styles |work=QuirksMode.org |url=http://www.quirksmode.org/css/lists.html}}</ref>
# Decide on a name for the cite label style group name. It should match the associated CSS {{code|list-style-type}} value. Quotes may not be used in values in {{tl|Reflist}} therefore the name ''must'' comply with the rules for HTML ids.<ref>{{cite web |title=HTML id Attribute |work=w3schools.com |url=http://www.w3schools.com/tags/att_standard_id.asp}}</ref>
# Discuss the new style on the talk page and gain consensus.
# Create the style list at MediaWiki:cite_link_label_group-''groupname''. Ensure each label is separated with a space. For example, create [[MediaWiki:cite link label group-lower-greek]] and populate it with the Greek alphabet. Then use "lower-greek" as the groupname.
# Redirect the talk page to the [[Help talk:Cite errors|central discussion page]] by creating the talk page with {{code|#REDIRECT [[Help talk:Cite errors]]}}.
# Edit {{tl|Reflist}} and add the {{code|list-style-type}} that styles the reference list.
# Add the style to the list above.
# If there are browser limitations, document them in the notice at the top of the page.
{{CSS list-style-type values}}
===Browser support===
The in-text link labels will be retrieved from the MediaWiki label page, thus they should show regardless of browser. The reference list labels are styled by the CSS {{code|list-style-type}} property. Not all browsers support all {{code|list-style-type}} values. A browser that does not support the value will revert to the default decimal label in the reference list. See the [[#CSS list-style-type values|table above]] for values and browser support.
===Error messages===
An error message indicates when there are more cites than there are link labels:
* {{MediaWiki:cite error no link label group|nocat=yes}}
This message is invoked through [[MediaWiki:cite error no link label group]]; the help page is at [[Help:Cite errors/Cite error no link label group]].
==Bugs==
* {{phab|24265}}
** The error message at [[MediaWiki:Cite error no link label group]] gets classed as a reference, so you can't use a wikilink in the message to link to a help page
** The reference list is an ordered list and uses numbers that don't match the in-text cite labels
==Classes and templates==
The {{tl|Reflist}} uses the {{para|group}} parameter to select the {{code|list-style-type}} style, and apply it to the {{code|.reflist}} class:
<syntaxhighlight lang="html+smarty">list-style-type: <!--
-->{{#switch: {{{group|}}}
| lower-alpha
| lower-greek
| lower-roman = {{{group}}}
| #default = decimal}};</syntaxhighlight>
:Note that the decimal style is handled by the default {{code|list-style-type}}.
CSS rules in [[MediaWiki:Common.css]] then allow the {{code|.references}} class to inherit the {{code|list-style-type}}:
<syntaxhighlight lang=css>
div.reflist ol.references {
list-style-type: inherit; /* Enable custom list style types */
}</syntaxhighlight>
==References==
{{reflist}}
{{Wikipedia referencing}}
[[Category:Wikipedia features|Cite Link Labels]]
[[Category:Wikipedia citation administration]]
{{notice|This help page is mainly of technical interest to those who are creating new label styles. For the use of defined styles, refer to [[WP:CITELABEL]].}}
When automated [[Help:Footnotes|footnotes]] are used on Wikipedia pages, the default form of the footnote labels is {{dummy ref|1}}, {{dummy ref|2}}, {{dummy ref|3}}, etc. When [[WP:REFGROUP|grouped footnotes]] are used, the labels are {{dummy ref|''name'' 1}}, {{dummy ref|''name'' 2}}, etc., where ''name'' is the name given to the group. However, by using certain reserved group names, it is possible to make the labels appear in a different form, such as {{dummy ref|i}}, {{dummy ref|ii}}, etc. or {{dummy ref|a}}, {{dummy ref|b}}, etc.
Currently existing reserved group names are:
{{Cite link label styles}}
For example, a footnote which is to appear in the i, ii, iii... group can be written as:
* {{tag|ref|params=group=lower-roman}}
To generate the list of the footnotes in that group, use for example
* {{tlx|reflist|2=group=lower-roman}}
Further examples, technical information and instructions for creating new reserved groups can be found below.
==Technical==
Version [[rev:66749|r66749]] of the {{Cite.php}} extension implements the ability to create styles for the cite link labels. Although the ability to create in-text cite label styles is unlimited, the matching reference list label styles are currently limited to those supported by the CSS {{code|list-style-type}} property and to browser support.
==Numeric labels==
The default in-text cite links and reference list backlinks use numeric labels automatically generated by the software. The labels are linked to provide a connection between the in-text cite and the reference list cite.
In this example, the super-scripted, in-text cites use a numeric label that matches the citation in the reference list:
{{markup
|<nowiki>The Sun is pretty big,<ref group="test">Miller, E: ''The Sun'', page 23. Academic Press, 2005.</ref>
but the Moon is not so big.<ref group="test">Brown, R: "Size of the Moon", ''Scientific American'', 51(78):46</ref>
The Sun is also quite hot.<ref group="test">Miller, E: ''The Sun'', page 34. Academic Press, 2005.</ref>
==References==
<references />
</nowiki>
|The Sun is pretty big,<ref group="test">Miller, E: ''The Sun'', page 23. Academic Press, 2005.</ref>
but the Moon is not so big.<ref group="test">Brown, R: "Size of the Moon", ''Scientific American'', 51(78):46</ref>
The Sun is also quite hot.<ref group="test">Miller, E: ''The Sun'', page 34. Academic Press, 2005.</ref>
{{fake heading|sub=3|References}}
{{reflist|group="test"|close}}}}
==Cite link sequence styles==
Special group names have been defined which give alternative sequences, such as alphabetical and roman numerals, instead of Arabic numerals.
===List of custom link label sequences===
{{Cite link label styles|interface=y}}
The list below is created automatically by [[Special:PrefixIndex]]:
<div>{{Special:PrefixIndex/MediaWiki:cite_link_label_group-}}</div>
===Markup restriction===
These sequences will only work properly when using the {{tl|Reflist}} template. Although the {{tag|references|s}} tag supports the {{code|1=group=}} attribute, the footnotes will be displayed with the default Arabic numerals.
===Creating cite label sequence styles===
Only admins can perform these actions. Non-admins may request additions on the talk page.
Currently, only styles supported by the CSS {{code|list-style-type}} element may be added.<ref>{{cite web |title=CSS list-style-type Property |work=w3schools.com |url=http://www.w3schools.com/css/pr_list-style-type.asp}}</ref> Not all styles are supported by all browsers— see the list below.<ref>{{cite web |title=List styles |work=QuirksMode.org |url=http://www.quirksmode.org/css/lists.html}}</ref>
# Decide on a name for the cite label style group name. It should match the associated CSS {{code|list-style-type}} value. Quotes may not be used in values in {{tl|Reflist}} therefore the name ''must'' comply with the rules for HTML ids.<ref>{{cite web |title=HTML id Attribute |work=w3schools.com |url=http://www.w3schools.com/tags/att_standard_id.asp}}</ref>
# Discuss the new style on the talk page and gain consensus.
# Create the style list at MediaWiki:cite_link_label_group-''groupname''. Ensure each label is separated with a space. For example, create [[MediaWiki:cite link label group-lower-greek]] and populate it with the Greek alphabet. Then use "lower-greek" as the groupname.
# Redirect the talk page to the [[Help talk:Cite errors|central discussion page]] by creating the talk page with {{code|#REDIRECT [[Help talk:Cite errors]]}}.
# Edit {{tl|Reflist}} and add the {{code|list-style-type}} that styles the reference list.
# Add the style to the list above.
# If there are browser limitations, document them in the notice at the top of the page.
{{CSS list-style-type values}}
===Browser support===
The in-text link labels will be retrieved from the MediaWiki label page, thus they should show regardless of browser. The reference list labels are styled by the CSS {{code|list-style-type}} property. Not all browsers support all {{code|list-style-type}} values. A browser that does not support the value will revert to the default decimal label in the reference list. See the [[#CSS list-style-type values|table above]] for values and browser support.
===Error messages===
An error message indicates when there are more cites than there are link labels:
* {{MediaWiki:cite error no link label group|nocat=yes}}
This message is invoked through [[MediaWiki:cite error no link label group]]; the help page is at [[Help:Cite errors/Cite error no link label group]].
==Bugs==
* {{phab|24265}}
** The error message at [[MediaWiki:Cite error no link label group]] gets classed as a reference, so you can't use a wikilink in the message to link to a help page
** The reference list is an ordered list and uses numbers that don't match the in-text cite labels
==Classes and templates==
The {{tl|Reflist}} uses the {{para|group}} parameter to select the {{code|list-style-type}} style, and apply it to the {{code|.reflist}} class:
<syntaxhighlight lang="html+smarty">list-style-type: <!--
-->{{#switch: {{{group|}}}
| lower-alpha
| lower-greek
| lower-roman = {{{group}}}
| #default = decimal}};</syntaxhighlight>
:Note that the decimal style is handled by the default {{code|list-style-type}}.
CSS rules in [[MediaWiki:Common.css]] then allow the {{code|.references}} class to inherit the {{code|list-style-type}}:
<syntaxhighlight lang=css>
div.reflist ol.references {
list-style-type: inherit; /* Enable custom list style types */
}</syntaxhighlight>
==References==
{{reflist}}
{{Wikipedia referencing}}
[[Category:Wikipedia features|Cite Link Labels]]
[[Category:Wikipedia citation administration]]