Cite/Cite.php: Difference between revisions
Revision as of 15:20, 12 January 2006
Any modifications or additions to this page should be made on mediawiki.org instead.
Imported with full page histories. --Roosa (Talk) 23:21, 27 June 2007 (UTC) [reply ]
Cite.php is a Cite extension that adds two parser hooks to MediaWiki, <ref>
and <references>
, these operate together to add citations to pages.
Synopsis
<ref[ name=["id"|id]]>
— the quotes are only needed if id contains whitespace, where whitespace is one of[\x09\x0a\x0d\x20]
<references/>
Description
<ref>
<ref>
defines inline citations that can be flushed out by <references>
, for instance:
- Uranus's moons were observed to be declining in orbit
<ref>
NASA</ref>
, by the Hubble space telescope<ref name="Popular Science">
[[December 2005]] issue, page 12</ref>
, the Martians were not available for comment on the matter<ref name="Popular Science"/>
. The New York times<ref name=NYT>
[[January 2006]] issue, page 16</ref>
however reported<ref name=NYT/>
that ...
would be rendered as:
- Uranus's moons were observed to be declining in orbit[1] , by the Hubble space telescope[2] , the Martians were not available for comment on the matter[2] . The New York times[3] however reported[3] that ...
<references>
<references>
flushes out the inline citations defined by <ref>
anywhere on the page, for example
<references/>
would yield:
- ↑ NASA
- ↑ a b December 2005 issue, page 12
- ↑ a b January 2006 issue, page 16
Customization
The format of the output of <ref>
and <references>
is almost completely customizable through MediaWiki messages, that can be modified e.g. though the MediaWiki namespace depending on the configuration of the wiki.
List of messages that control the output of <ref>
and <references>
and the values, if any, that are passed to them (1,ドル 2,ドル 3ドル ...), see the code in CVS for an up-to-date listing of their default contents.
- cite_reference_link_key_with_num
- key
- num
- cite_reference_link_prefix
- cite_reference_link_suffix
- cite_references_link_prefix
- cite_references_link_suffix
- cite_reference_link
- ref ID
- backlink ID
- count to display
- cite_references_link_one
- backlink ID
- ref ID
- text of note
- cite_references_link_many
- backlink ID
- list of links
- text of note
- cite_references_link_many_format
- ref ID
- numeric value to use as a backlink
- custom value (as defined in cite_references_link_many_format_backlink_labels to use as a backlink)
- cite_references_link_many_format_backlink_labels
- cite_references_link_many_sep
- cite_references_link_many_and
- cite_references_prefix
- cite_references_suffix
Issues
Current issues
- Using <ref> in image captions breaks the XHMTL output
- Issue with MediaWiki, not this extension, see bug 1887.
- The citation links generated by <ref> and the backlinks generated by <references> have an empty
title
attribute (<a href="..." title="">...
) - Issue with MediaWiki, not this extension. MediaWiki will generate output like
<a href="#foo" title="">bar</a>
when given input like[[#foo|bar]]
Past issues
- The extension didn't generate id attributes that could be uniformly styled with CSS2 attribute selectors
- Issue in Cite.php, see bug 4579
- Using multibyte characters, colons, spaces and other values that need to be encoded according to the HTML spec breaks internal links
- Issue with MediaWiki, not this extension, see bug 4461.