Closed odkr closed 5 years ago
@odkr This looks brilliant - I've long wanted to have something less hacky than a python script. I'll test it, but at first glance it looks great. Thank you!!
Thanks! I haven’t yet added support for BetterBibTex though.
@odkr I'm trying to get the tests to run on this. Everything looks great to me and I really appreciate the work. I think the test problem is in zotxt but I'm not sure at the moment.
Are you referring to the tests in pandoc-zotxt/tests/test_zotxt.py
? At a first glance, most of the code there appears to be machinery for the tests and there are, correct me if I'm wrong, four test cases:
My test suite covers all of these cases, save for the second one.
If that helps I can try to tidy up my test suite a bit and include a similar case. (It may take me some time though; I'm currently pre-occupied with other things.)
Lua is unicode-agnostic; and there's a very real chance things can go wrong here. (I’m thinking of non-ASCII characters that consist of multiple octets in non-normalised order; but given that Zotero doesn’t normalise strings either, at least it didn’t last time I checked, there is probably not much that can be done about this.)
Hey, I recently had a look at the code again. I've cleaned it up a bit and added the feature of letting pandoc-zotxt.lua
'manage' JSON bibliography files.
Sorry for the noise, but my Lua is rusty, it appears ;).
I'm sorry this fell off my radar. I'm going to merge now. This is so much better than pandoc-zotxt (python). I'll try to update the README to mention it and deprecate the python code (which I haven't been keeping up-to-date). Thanks again!
No worries. (I just found out that there's a one year old PR on one of my repos. It happens.) I've improved the error handling of pandoc-zotxt.lua in the meantime. I'll open a new PR. But that should be it for the time being.
This is a Lua filter for pandoc that does more or less the same pandoc-zotxt does. I had hoped for it to be faster than the original, but it isn't. (I wrongly assumed that I could retrieve multiple citation items concurrently in Lua; but Pandoc doesn't support that.) However, it ships with its only dependency, a JSON library, and doesn't require anything to run but Pandoc itself. So maybe it's useful for some people.