Copyright (c) 2013 Tony Boyles
This project is a fork of Javascript BibTeX Parser, Which is Copyrighted (c) 2008 by Simon Fraser University, written by Steve Hannah, and distributed under the GPL v.3
WHY?
The original library was a port of the PHP Structures_BibTex library. To facilitate the conversion of the codebase, many global functions were borrowed from php.js. The Unfortunate result of this design decision was that much of the code doesn't resemble Javascript at all, but rather reads like PHP. One of the primary tasks of this fork is to eliminate all of these alien structures such that the code behaves in a way that's more familiar to modern Javascript.
WHY DID YOU DO THIS?
I wanted to build an agile, client-side only website that could showcase my resume, similar to what can be done using OpenScholar, only with a much smaller footprint. One of the features I especially liked about OpenScholar was the way it consumed and exported BibTeX with exactly zero nonsense. That's a hard act to match using client-side code only, but I was up for the challenge when I realized the first half of the project already existed and was basically abandoned.
USE
This library is a simple Javascript library. To use it, just load it up in your app:
<script src="jsBibTeX.js"></script>
Now, the important part is parsing your BibTeX, so let's imagine you have some BibTeX embedded in an invisible div, like this:
<div id="myBibliography" style="display:none">
@book{von2007theory,
title={Theory of games and economic behavior},
author={Von Neumann, John and Morgenstern, Oskar},
year={1943},
publisher={Princeton university press}
}
</div>
We can get your raw BibTeX in Javascript by calling:
var rawBibTeX = document.getElementById("myBibliography");
There are two ways to use jsBibTeX, but underneath the hood they're almost exactly the same. You can use the jsBibTeX global variable, or you can instantiate your own BibTeX objects.
Quick
You can access it by calling its global variable, jsBibTeX. Note the capitalization -- if it irritates you, just copy the reference to whatever name you want, like so:
var bib = jsBibTeX;
LICENSE
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/