Extension:HarvardReferences

The HarvardReferences extension allows to use the author-date ("Harvard system") referencing style, e.g. Smith 2008:1

Referencing systems
There is common scientific standard (Harvard referencing system).  The two most common types of referencing systems used are:
 * author-date systems — such as the Harvard system, APA and MLA
 * numerical systems — such as Chicago or Turabian, Vancouver and Footnote 

This MediaWiki extension implements an author-date (Harvard) system.

Working example
You can test this extension here: http://wikiext.org/index.php/Harvard_references_sample Use backspace key to return from references to the main text.

Sandbox to test extension
Please use sandbox to test extension: http://wikiext.org/index.php/Sandbox:Test_page

Description
This extension supports Author-date ("Harvard system") referencing style, e.g. Smith 2008:1, as commonly used standard in scientific literature.


 * Link - in square brackets: [Smith 2008]
 * Anchor to link - [*Smith 2008]

Compatibility with Cite.php
This extension is compatible with Extension:Cite/Cite.php - links in both systems can be used in same article. Moreover, links in "Harvard" system can be inserted into description of ref-link, and vice versa. For example,

Example of Harvard References
According to scientists, the Sun is pretty big.[Miller 2005] The Moon, however, is not so big.[Smith 1978:121]

Page numbers in references
Optional page numbers can be used after ":" symbol in link. Several links with one name and different page numbers can refer to one anchor. For example, [Smith 2008:121] [Smith 2008:51] refers to one anchor with same name: [*Smith 2008]

You may use "|" instead of ":" as a separator.

Setup
Extension was tested on 1.15.3 version of MediaWiki.

To install this extension, make HarvardReferences.php (source code is below) in folder extensions/HarvardReferences.

Then write  in bottom of file LocalSettings.php.

If you want extended highlighting, you can use additional JS and CSS written for this extension, see Extension:HarvardReferences/Scripts. This will provide your wiki with highlighting of the references and backlinks. These scripts also allow user to change their appearance.

Switching on
To enable this advanced syntax globally, put right after the "require_once" line.

Or, if it wasn't done, you may use tag  (anywhere in the article text) to enable this extension on a per-page basis.

Source code
Make file HarvardReferences.php in ANSI encoding (do not add any spaces before starting "  "). Installing of this code into MediaWiki site see above.