-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error printed if key not in Zotero, but in metadata or bibliography #4
Comments
Good point! pandoc-zotxt.lua behaves this way because zotxt used to return error messages, not strack traces in that case. That no longer makes sense. Also, pandoc-zotxt.lua shouldn't try to look up keys that are in the |
I haven’t fully tested it, but as of commit 9226cdc, pandoc-zotxt.lua should fetch sources from Zotero if and only if they are defined neither in the |
I made a pre-release, if you want to test it. https://github.com/odkr/pandoc-zotxt.lua/releases/tag/v1.0.1b |
I downloaded v1.0.1b. It works on the test case above, but when I run it on the document that led me to report this issue, it fails like this:
That document has a YAML bibliography specified in its metadata, and does not use the Here's an MWE to produce the above error:
|
Also: * Support for reading IDs from BibTeX/BibLaTeX bibliography files. * Now uses a temporary file when updating its bibliography file (safer). Bugs fixed: * New bug reported in issue #4 * Supports --resource-path now. Refactoring: * Parses data retrieved from zotxt more defensively. * Code is more defensive overall. * Renamed many functions to maintain a semblance of order. Closes #5
Sorry, I was busy. I’ve added your MWE to the test suite, which now passes. Have a look at https://github.com/odkr/pandoc-zotxt.lua/releases/tag/v1.1.0b and tell me if it works. Opening this again for the time being. |
I found time to test this, and the test case does work. When I tested it on a larger document, I got |
Thanks for testing this again. I'll have to think about how to handle |
Can now handle CSL YAML bibliography files with or without `---` and `...`. Also now uses Pandoc's CSL YAML and BibTeX/BibLaTeX parsers if possible. This should address the other bug in #4. The new `walk` function will also allow to search for citation keys in metadata, which will allow to address another issue.
So, switching to Pandoc for parsing YAML, while a good idea in general, wasn't quite as useful as expected. The Lua library can't handle |
The filter now seems happy with my document, which gets some items from its YAML bibliography, and others from Zotero via the filter. I first tested without I noticed that if Zotero is not running, I get this error:
I easily guessed that the problem was that i had forgotten to start Zotero, but you should probably have a clearer error message for that case. |
I'm still installing the script manually. This time I tried
This is on macOS 11.4. My manual installation method is to unpack the zip under my Pandoc Lua filters directory and then copy |
Addresses new issue in #4. But isn't beautiful enough just yet.
Great!
That’s not so much an error message as a bug in the error handling mechanism ;-).
I’m not surprised that the installer is still buggy. That bug in particular does surprise me though. I'll write some tests for the installer. |
* Now uses `pandoc.system.with_temporary_directory` if available. * Removed `tmp_file` in favour of `with_tmp_file` for consistency. (And because the garbage collector doesn't run if pandoc receives a signal at any rate.) * Now prefixes temporary files with 'pdz-'. * Also uses custom error objects for zotxt errors, so those look nicer. This should address the ugly error messages discussed in issue #4.
Hopefully this addresses the issues with the installer reported in issue #4.
I had another look at those error message, and they should be more legible now. And I decided to drop the installer. You can find a new beta version at https://github.com/odkr/pandoc-zotxt.lua/releases/tag/v1.1.0b3. |
Closing this because v1.1.0b7 is stable enough. I'll release it once I am sure it will work with the next release of Pandoc. |
I finally got back to a project using this filter, and updated to 1.1.0b7.
|
MWE for a test case: On the positive side:
|
Thanks for taking the time! I, too, have noticed this error message in testing. zotxt throws this exception when a user runs a query with a -- syntactically invalid -- Zotero item ID that contains an underscore. However, if a citation key matches no item, |
There's a new beta that addresses this (and other) issues: https://github.com/odkr/pandoc-zotxt.lua/releases/tag/v1.2.0b |
I installed and tried 1.2.0 today, and encountered no issues. |
Great :-). |
With version 1.0.0 of the filter, if a key is cited that is not in Zotero, but is defined in a bibliography file or in
references
metadata, the filter prints an error and a stack trace from Zotero. I think it should print nothing in this case. A warning that the reference is not in Zotero would be OK, but I think it is unnecessary, because if the key is not defined elsewhere citeproc will already warn about this. The error that is currently printed does not make it clear what is wrong, and the stack trace is unnecessary.Sample to reproduce the problem:
Place the above in
foo.md
and runpandoc foo.md -L pandoc-zotxt.lua --citeproc -o foo.pdf
:The text was updated successfully, but these errors were encountered: