This uses BibTeX as intermediary format. The full XML format provided by CrossRef may contain more information, but a mapping to MODS or directly to CSL-Data must be defined. Conversion of BibTeX to CSL-Data is done by pandoc-citeproc
#!/bin/bash
DOI=10.1371/journal.pone.0010676
curl -H accept:application/x-bibtex http://data.crossref.org/$DOI > bibtex.bib &&
pandoc-citeproc --bib2json bibtex.bib > csl-data.json
To create a citation from CSL-Data, use any CSL-Processor. This is how I do it. First I create a YAML file with Catmandu:
catmandu convert JSON --multiline 1 to YAML \
--fix 'prepend(id,@);copy_field(id,nocite);retain_field(nocite)' \
< csl-data.json > pandoc-yaml.yml
echo ... >> pandoc-yaml.yml # unless https://github.com/LibreCat/Catmandu/issues/110 is fixed
Sure it's easier to create the file by hand, but then it's not automatic.
$ cat pandoc-yaml.yml
---
nocite: "@Williams_2010"
...
Then convert with pandoc to any format you like (HTML, ODT, LaTeX, plain text...)
pandoc --bibliography csl-data.json pandoc-yaml.yml -t plain
pandoc --bibliography csl-data.json pandoc-yaml.yml -t html
pandoc --bibliography csl-data.json pandoc-yaml.yml -t latex
...
The result in HTML:
Williams, Jeffrey T., Kent E. Carpenter, James L. Van Tassell, Paul Hoetjes, Wes Toller, Peter Etnoyer, and Michael Smith. 2010. “Biodiversity Assessment of the Fishes of Saba Bank Atoll, Netherlands Antilles.” Edited by Brian Gratwicke. PLoS ONE 5 (5) (May): e10676. doi:10.1371/journal.pone.0010676. http://dx.doi.org/10.1371/journal.pone.0010676.