On Tue, Oct 27, 2015 at 11:31 PM, Matt Lundin wrote: > Matt Price writes: > > > On Tue, Oct 27, 2015 at 9:51 AM, Rasmus wrote: > > > > > > Aaron Ecay writes: > > > > Indeed. I guess this is what they use: > > > > https://github.com/zotero/citeproc-node > > > > It also looks rather complex... > > > > > > FWIW, I just tried installing this on my Arch system, but it doesn't > > work with node 0.12, and I am currently unable to switch to io.js due > > to dependencies of several other projects. I guess tools like NVM can > > help with this situation, but I worry that node is currently a moving > > target and might lead to lots of platform-dependent buggy behaviour. > > Testing it now... Works fine on my Arch system. Arch's current nodejs is > 4.2. As I understand it, io.js has been merged back into node 4.+ > upgraded from 0.12, and it works fine. My problem before was that some important npm packages were still incompatible with node 4.2; it may be that that's no longer an issue, and I spoke too soon. > > The citeproc-node server itself is not very complex. It's just a node > wrapper around citeproc-js. The big limitation, it seems to me, is that > it only accepts a json format as input. Also it seems to use html markup > in all its output formats. > That does seem to be an issue, but I bet it wouldn't be too hard to fix. Currently outputformat is hardcoded on line 94 of lib/citeServer.js; I'm a little slow at reading JS but I think replacing line 259 with a switch statement analogous to the one for responseformat at line 291 would allow one to use the full capacities of citeproc.js. I think the best route would probably be to submit a patch to citeproc.js adding an org-mode output format, propagating that up to citeproc-node, submitting a second patch to citeproc-node, and then writing the org-internal functions properly. We might also want to add an additional responseformat option. It might take a month or two to get all those changes accepted, but we could probably do the org-mode development simultaneously, and it would be worth the wait to have a stable solution. My experience with the citeproc-js maintainer is that he is very helpful and responsive to feature requests. I am a slow coder but would be happy to invest some time in this if it's the direction the community wants to go in. Adding a new output format to citeproc-js is not that complex; see https://bitbucket.org/fbennett/citeproc-js/src/tip/src/formats.js?fileviewer=file-view-default > Though published by the Zotero programmers, citeproc-node, I believe, is > distinct from the citeproc-js implementation in Zotero, which is a XUL > application. > > I think that's right. If we could avoid dependencies on Zotero that would be good; it is a pretty substantial program, takes up a significant amount of RAM at runtime, and relies on a GUI environment, which neither emacs nor pandoc does. > Matt >