dev-master
9999999-devA php processor for the citation style language CSL (http://citationstyles.org)
MIT
The Requires
- php >=5.3.2
csl citation
Wallogit.com
2017 © Pedro Peláez
A php processor for the citation style language CSL (http://citationstyles.org)
This project is still in an early alpha state, nearly the half of the tests are failing. The goal is to implement a parser which is 100% compatible with the CSL 1.0.1 standard, 100% clean OOP and follows the PSR-2 coding standard., (*1)
Add to the composer.json the require key and run composer install., (*2)
"require" : {
"geissler/csl": "dev-master"
}
Make sure you are using a PSR-2 compatible autoloader., (*3)
Render a single bibliography entry., (*4)
// include the composer autoloader
require __DIR__ . '/vendor/autoload.php';
use Geissler\CSL\CSL;
// the name of the style you want to use
$style = 'american-journal-of-archaeology';
// the data do be displayed as a json array
$input = '[
{
"id": "ITEM-1",
"author" : [
{
"family": "Wallace-Hadrill",
"given": "Andrew"
}
],
"issued": {
"date-parts": [
[
"2011"
]
]
},
"title": "The monumental centre of Herculaneum. In search of the identities of the public buildings",
"container-title" : "Journal of Roman Archaeology",
"volume" : "24",
"page" : "121-160",
"original-publisher-place" : "Ann Arbor, Mich.",
"type": "article-journal"
}
]';
$csl = new CSL();
echo $csl->bibliography($style, $input);
// this will output the following
Wallace-Hadrill, Andrew. 2011. "The monumental centre of Herculaneum. In search of the identities of the public
buildings". Journal of Roman archaeology 24: 121-160.
As HTML, (*5)
Wallace-Hadrill, Andrew. 2011. "The monumental centre of Herculaneum. In search of the identities of the public buildings". Journal of Roman archaeology 24: 121-160.
The following options can be configured via the configuration.ini:, (*6)
The files under styles are taken from the CSL styles repository and the files under locales are taken from the CSL locales repository., (*7)
Most of the examples for the phpunit-tests under tests/src, all files in tests/citeproc-test and some comments are taken/copied from CiteProc Test, "the standard test bundle for use in CSL processor and style development" written by Frank G. Bennett, Jr. and Bruce D'Arcus., (*9)
A php processor for the citation style language CSL (http://citationstyles.org)
MIT
csl citation