The Wikipedia footnotes system uses the Cite.php software extension to generate references.
This help page is a how-to guide. It details processes or procedures of some aspect(s) of Wikipedia's norms and practices. It is not one of Wiki's policies or guidelines, and may reflect varying levels of consensus and vetting. |
This is a very technical how-to mainly of interest to editors who work with the footnotes system and related templates |
MediaWiki messages are then used to format the display of the inline links and the references.
...
; shown in superscript and enclosed in brackets; coded in the MediaWiki message as $2...
that shows in the reference list; coded as $3MediaWiki interface page | Use | Current |
---|---|---|
Cite reference link | format inline link | <sup id="$1" class="reference">[[#$2|[$3]]]sup>
|
Cite references link many | format reference with multiple backlinks | <li id="$1"><span class="mw-cite-backlink">^ $2span> $3li>
|
Cite references link many and | | |
Cite references link many format | [[#$1|<sup>'''''$3'''''sup>]]
| |
Cite references link many format backlink labels | backlink labels used in the reference list | currently from a to azz |
Cite references link many sep | | |
Cite references link one | format reference with single backlink | <li id="$1"$4><span class="mw-cite-backlink">'''[[#$2|^]]'''span> $3li>
|
Cite references prefix | prefix for
| [[:MediaWiki:Cite references prefix]] |
Cite references suffix | suffix for
| [[:MediaWiki:Cite references suffix]] |
Cite reference link key with num | [[:MediaWiki:Cite reference link key with num]]
| |
Cite reference link prefix | inline link prefix | [[:MediaWiki:Cite reference link prefix]] |
Cite reference link suffix | inline link suffix | [[:MediaWiki:Cite reference link suffix]] |
Cite references link prefix | reference list link prefix | [[:MediaWiki:Cite references link prefix]] |
Cite references link suffix | reference list link suffix | [[:MediaWiki:Cite references link suffix]] |
Cite references no link | [[:MediaWiki:Cite references no link]] | |
Cite references link many accessibility label | accessibility label for screen readers | Jump up to: |
Class .reference formats the inline link; defined in Common.css
/* Ensure refs in table headers and the like aren't bold or italic */ sup.reference { font-weight: normal; font-style: normal; } /* Prevent line breaks in silly places: 3) Ref tags with group names --> "[Note 1]" */ sup.reference a { white-space: nowrap; }
Class .references formats the reference list; defined in Common.css When the inline cite link is clicked, the focus jumps to the proper cite in the reference list. The following rules highlight the cite in light blue. This is supported by Gecko (FireFox) and Webkit (Safari, Chrome) browsers; it is not supported by current versions of Trident, but does work in the Internet Explore 9 platform preview.
/* Highlight clicked reference in blue to help navigation */ div.references li:target, sup.reference:target, span.citation:target { background-color: #DEF; }
Although not specific to references, Common.css does have this line height rule to keep line spacing from breaking on subscript and superscript, as used in the inline link. Internet Explorer 7 has problems with line-height
when printing, so it is disabled for IE7 through Common.js.
/* Reduce line-height for and */ sup, sub { line-height: 1em; }
Cite errors are classed with:
The extension uses some modules for CSS:
The inline reference links are defined in MediaWiki:Cite reference link. The default is:
<sup id="$1" class="reference">[[#$2|<nowiki>[nowiki>$3<nowiki>]nowiki>]]sup>
Where:
The English Wikipedia customizes this to:
<sup id="$1" class="reference">[[#$2|[$3]]]sup>
Where the brackets that show enclosing the reference count are enclosed in tags so they can be styled.
The backlink label type is defined in MediaWiki:Cite references link many format. This interface page defaults to:
[[#$1|<sup>'''''$2'''''sup>]]
Where:
The English Wikipedia interface page is set to:
[[#$1|<sup>'''''$3'''''sup>]]
Changing $2
to $3
changes the backlinks from numeric to alpha. This was modified in 2006 to match the output of {{ref}} which was the predominant method of inserting footnotes at the time.
This is the markup for some simple references
Unnamed <ref>This is an unnamed referenceref> Named <ref name="named">This is a named referenceref> Named reference used again <ref name="named"/> <references/>
Which shows as
Unnamed
Named
Named reference used again
Which renders as
The MediaWiki messages are combined to form the HTML output
<p>Unnamed <sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title=""><span>[span>1<span>]span>a>sup>p> <p>Named <sup id="cite_ref-named_1-0" class="reference"><a href="#cite_note-named-1" title=""><span>[span>2<span>]span>a>sup>p> <p>Named reference used again <sup id="cite_ref-named_1-1" class="reference"><a href="#cite_note-named-1" title=""><span>[span>2<span>]span>a>sup>p> <div class="references"> <ol> <li id="cite_note-0"><b><a href="#cite_ref-0" title="">^a>b> This is an unnamed referenceli> <li id="cite_note-named-1">^ <a href="#cite_ref-named_1-0" title=""><sup><i><b>ab>i>sup>a> <a href="#cite_ref-named_1-1" title=""><sup><i><b>bb>i>sup>a> This is a named referenceli> ol> div>
If citation templates are used, they will inject other classes and ids into the HTML output.
This article uses material from the Wikipedia English article Help:Cite messages, which is released under the Creative Commons Attribution-ShareAlike 3.0 license ("CC BY-SA 3.0"); additional terms may apply (view authors). Content is available under CC BY-SA 4.0 unless otherwise noted. Images, videos and audio are available under their respective licenses.
®Wikipedia is a registered trademark of the Wiki Foundation, Inc. Wiki English (DUHOCTRUNGQUOC.VN) is an independent company and has no affiliation with Wiki Foundation.