Need help with citeproc-js?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

187 Stars 59 Forks Other 6.0K Commits 20 Opened issues


A JavaScript implementation of the Citation Style Language (CSL)

Services available


Need anything else?

Contributors list



A JavaScript implementation of the Citation Style Language

:Authors: Frank Bennett

.. image:: :target:



Citation Style Language
_ (CSL) is an XML grammar for expressing the detailed requirements of a citation style. A
CSL processor
_ is a tool that generates citations and bibliographies by applying CSL style rules to bibliographic data.


CSL processor is over a decade in service, a fact that shows through in ways both good and bad. On the downside, the code base is not pretty, and can serve as a solid illustration of the burden of technical debt (in case you need one of those for your computer science class). On the upside, though,
passes a suite of over 1,300 integration tests with flying colors. When run in CSL-M mode [1]_ it can handle multilingual and legal content with a flexibility and precision unrivaled by any other tool at any price. And it has been quite heavily field-tested, as the citation formatter driving word processor integration in both
_ and

More important than fleeting badges of popularity, though, is the CSL standard. Developers can take comfort in the technical strength of the

CSL Specification
, and the existence of
other processors
under active development. CSL is the modern way to handle bibliographic projects, and
is a convenient way to take advantage of it.

Submitting bug reports

If you think you have found a processor bug, you can help track it down by submitting a test item or items that expose the error. To submit an item, join the public

Jurism Test Submission group
, sync, create a collection named for the style that shows the error, drop the item into it, jot a description of the problem in the Abstract field, and sync again.

For errors not associated with a particular style or item, file reports on the

citeproc-js GitHub tracker 

Building the processor

The processor files

` are built automatically when tests are run (see below).

Running Tests

The processor is supported by a little over 1,300 test fixtures, which can be run from a

clone of this repository after installing the
Citeproc Test Runner
_. The system requirements (apart from
itself) are:
    Needed to fetch a clone of the ``citeproc-js`` repository on GitHub.
    Any recent-ish version should work. Version 7 is used for automated testing.
    Install Mocha globally with ``npm install --global mocha``.
    This is used to perform schema validation. Browser extension is not
    required, a basic command-line install is all you need.

Once the system requirements are set up, install the test runner with the following command::

npm install -g citeproc-test-runner

You can now run the full suite of integration tests from the

directory with the following command:

cslrun -a

You can review the full set of options by running

cslrun -h
. For more information on running tests, see the
citeproc-js Manual
_ or the README of the
Citeproc Test Runner

Repository Content

The processor itself is contained in a single file. Two copies are in the repository:

(an ES6 module); and
(a raw bundle of JavaScript). The former is probably what you will want for most purposes today.

The following command will pull the sources of the processor and supporting files::

git clone --recursive

Directories of the repository contain a number of tools used for development and testing:

Processor source files. These are bundled into the two processor copies by the test script
, distributed separately in the
package via
(see below for details).

The RelaxNG schemata for CSL and CSL-M. These are used to validate style code. The schemata are not used directly by the processor at runtime.

Contains a simple example of processor configuration in a Web environment. Can be viewed by running a local webserver in the directory.

Source files for the
manual on

Integration test fixtures specific to the
processor or to the CSL-M grammar variant.

Standard CSL integration tests from the
Citation Style Language
_ repository.

Style-level tests. For more information, see the
citeproc-js Manual
_ or the README of the
Citeproc Test Runner

Jurisdiction modules. These are used to CSL-M mode to render legal citations in country-specific forms.

standard locale files 
_ from the CSL project.

An assortment of scripts that are used, or have been used at some point, in the maintenance of

.. [1] CSL-M is set of private extensions to official CSL used by the

_ reference manager, a variant of Zotero. For more information, see the
citeproc-js Manual

| 2019.03.27 | FB

.. _csl processor: .. _mendeley: .. _zotero: .. _csl specification: .. _other processors: .. _citeproc-js Manual: .. _citation style language:

.. _citeproc test runner:>

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.