Skip to content

Another CiteProc library for use in PHP applications

License

Notifications You must be signed in to change notification settings

mettio/citeprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CiteProcessor

Build Status License PHP

Description

This is an another effort to implement a standalone CSL processor in PHP. This program can be used to render bibliographies using CSL Stylesheets. This repository is a fork of the implementation of Sebastian Böttger which is a fork of the implementation of rjerome (apparently no longer maintained).

I renamed it to citeprocessor because of use it for personal purposes.

Some advantages:

  • uses Composer
  • each class is located in a separate file
  • uses namespaces
  • uses the autoloader of Composer
  • uses PHPUnit for testing
  • better integration

Installing citeprocessorp using Composer

Use Composer to add citeprocessor to your app by editing your composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:mettio/citeprocessor.git"
        }
    ],

...

    "require": {
        ...
        "mett/citeproc":"*"
    },

After that, run composer update in your project root directory.

How to use it

<?php
include 'vendor/autoload.php';
use \Mett\CiteProc\CiteProc;

$bibliographyStyleName = 'apa';
$lang = "en-US";

$csl = CiteProc::loadStyleSheet($bibliographyStyleName); // xml code of your csl stylesheet

$citeProc = new CiteProc($csl, $lang);

// $data is a JSON encoded string
echo $citeProc->render(json_decode($data));
?>

How to run the tests

Run phpunit in the project root and you will be fine.

ToDo

  • Refactor code
  • Document code
  • Testing
  • Document properties
  • Implement some missing features

About

Another CiteProc library for use in PHP applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages