zotero / citeproc-js-server

Web service to generate citations and bibliographies using citeproc-js
Other
60 stars 39 forks source link

How hard would it be to create a command-line utility? #25

Closed titaniumbones closed 8 years ago

titaniumbones commented 8 years ago

Hi,

On the org-mode list we are having a discussion about how to add citation formatting support to our export capability (org-mode is a syntax similar to markdown, used mostly by Emacs users; it has pretty sophisticated exports to many formats including Latex, HTML, and ODT). One option is to use citeproc-node, but if possible I would like to have a very simple command-line tool which doesn't require the use of even a simple http server. Do you think this is an achievable goal? If so, can you give some hints about where to start looking? Thanks! Matt

adam3smith commented 8 years ago

both in case you missed it and, if you're aware, to understand the nature of your request better: why not just use pandoc (with built-in pandoc-citeproc) for citations? Also, the list of CSL citeprocs: http://citationstyles.org/developers/#CSL_Processors does include several that would appear like more suitable for commandline integration (ruby, python). Why not use those? (All that said, I do believe this would generally be possible, though I'm not sure going through citeproc-node is the best approach if you don't want a server. Might be easier to just write a script that wraps @fbennett 's citeproc-js directly (that's essentially what his own test suite does as well as the visual csl-editor. Documentation for citeproc-js here: gsl-nagoya-u.net/http/pub/citeproc-doc.html )

dstillman commented 8 years ago

Yeah, if you don't want HTTP, the code here mostly isn't relevant, but if you want to use citeproc-js you can see https://github.com/zotero/citeproc-node/blob/master/node_example.js for an example. (The naming of this repo may be a little confusing — I think we're going to rename this one to citeproc-http and make citeproc-node just the node-based citeproc-js wrapper, which would in turn be used by citeproc-http.)

fbennett commented 8 years ago

@titaniumbones I use org-mode myself, and if there is any way I can help with citation support, just give a shout. The pandoc processor would also be a solid choice, but I would be kinda keen personally to help you get things running with citeproc-js, to have support for legal resources.

titaniumbones commented 8 years ago

Thank you everyone for the comments. In fact some provisional code using pandoc-citeproc already exists, but there's concern on the list that it brings in lots of dependencies that aren't installed on many people's machines.

I'll look at the very simple node example, that will doubtless help. I may be out of my league on this one but will continue to make an effort. @fbennett, there are ongoing conversations about citation on the org-mode list, and I am hopeful this latest push will finally get us real citation support. I'm sure you'd be very welcome in those ocnversations, and when I have a bit more time and a better sense of what really needs to be done I will be in touch again!