A CSL validator for JavaScript based on RelaxNG and compiled to JS via emscripten. To use, include csl-validator.js and call:
var output = validate("string");
output
will be the output of the rnv command-line tool.
To compile an updated csl-validator.js
with a new CSL schema:
git clone --recursive git://github.com/zotero/csl-validator.js.git
- Update
deps/schema
- Edit the Makefile to set the correct path for
csl.rnc
. Check thecsl.rnc
file for updated includes and update theschema.js
part ofMakefile
if necessary. - Run
make clean && make
To compile RelaxNG:
- Get emscripten and node.js
git clone --recursive git://github.com/zotero/csl-validator.js.git
- Edit the Makefile to set the path to emscripten
make clean-all && make relax-ng.js
- If this fails
cd deps/expat-2.1.0 && sudo make install
, then runmake
in the root directory again andcd deps/expat-2.1.0 && sudo make uninstall