Hi all,
Some of you may be familiar with MathJax. It is an javascript library
that allows people to embed LaTeX math in their HTML and have it
displayed properly in the browser. Basically, you include a javascript
file, and MathJax will then scan your HTML and LaTeX math embedded in
\( ... \) into rendered math. (See
http://util.io/mathjax for a demo).
It occurs to me that it would be possible (and not too difficult) to
create something similar with citeproc-js, the Zotero server API (or
CSL-JSON files), and pandoc-style citations (for which I have created
a Javascript parser using pegjs). In this way, users could include a
Javascript file, and then write in their HTML files, for example:
<p>@DoeBook2005 [p. 30] says blah.</p>
<p>@DoeBook2005 [-@DoeArticle2006 p. 30; see also @DoeWhy2007] says blah.</p>
<p>@@bibliography</p>
And have this translated into:
<p>Doe (2005, 30) says blah.</p>
<p>Doe (2005; 2006, 30; see also Doe and Roe 2007) says blah.</p>
<h1>References</h1>
<div class="csl-bib-body container">
<div class="csl-entry container">Doe, John. 2005. <em>First Book</em>. Cambridge: Cambridge University Press.</div>
<div class="csl-entry container">———. 2006. “Article.” <em>Journal of Generic Studies</em> 6: 33–34.</div>
<div class="csl-entry container">Doe, John, and Jenny Roe. 2007. “Why Water Is Wet.” In <em>Third Book</em>, edited by Sam Smith. Oxford: Oxford University Press.</div>
</div>
The great thing about this approach is that it can work with *any*
blogging, content management, or HTML authoring platform. MathJax has
proven very popular with the math and scientific community. I think
that a MathJax like approach for citations and bibliographies for HTML
could be similarly popular in the general academic community.
Any thoughts?
best, Erik