Last modified: 2012-10-29 17:24:05 UTC
For an extension to Cite that I am working on (http://www.mediawiki.org/wiki/Extension:ProcessCite), I added the following hook to Cite.php at the beginning of the function stack: wfRunHooks( 'CiteBeforeStackEntry', array( &$key, &$str ) ); I am using this to do additional processing of $key and $str. The functionality of my extension, which I am calling ProcessCite.php for now, can be seen at http://ecoliwiki.net/colipedia/index.php/Help:References In brief, ProcessCite: 1) fetches, caches, and formats reference info for citations to papers in the NLM PubMed database, using PubMed's E-Utilities web service. 2) fetches reference information from a list of commonly used shortcuts stored in a specific wiki page 3) allows more concise markup of these kinds of citations 4) disambiguates several ways in which citations might be entered into Cite. ProcessCite is written with biomedical/genomics wikis in mind, but and I think that other Cite extensions could be written along the same lines.
To brion for comments.
Wouldn't it be almost as easy for your extension to subclass Cite? Then you could provide whatever hooks you wanted by overriding the appropriate methods. The structure shouldn't change too often, so the maintenance shouldn't be too involved.
Interesting alternative. But it seems like it could be more baroque to have my extension just to provide hooks into Cite, and then have other extensions depend on that, instead of just adding one line of code to Cite.
Bumping -- Cite has gotten a bit more complicated, with support for multiple groups. If this is still required, where should it go and what parameters should it take?
Thanks Brion, I will look at the version of Cite in svn to try to answer these questions.