-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Eta-template was not working like before #2791
Comments
Things aren't serialized from JSON. Things are serialized to JSON, and none of the fields included in
Yeah that was in the template, not the data. There's no newlines in the fields you are accessing, and BBT didn't put any there), and #2789 only made changes to import, not export. If you change the last line of your template into
I don't know how to interpret this. I don't know what it means. For experimentation you might find it easier to paste the code below into the ETA playground and toy around until you have what you want; I've just prepended the item contents of
|
It does seem to me at this point it would be easier to create your own translator rather than using |
Thank you for your efforts. You are right when pointing me to a special translator. I will see how far I can get. @retorquere wrote
In the Zen of Python there are two aphorisms relatet to this:
On the second point: a closed ticket mentioning a |
Removing the hyphens in the last line of the template worked for me! Obvious on second sight. I update my Gits |
But there wasn't an error that was passed silently. There was undesirable behavior that was expected given the input. I don't see how you could programmatically detect this and notify the user (and if such notification isn't the point, then I still don't know what, exactly, should not pass silently).
Much of what we have been discussing here is documented behavior from the |
For your peace of mind: The error was mine not your code. Clear for me, hopefully now also for the audience. This is reflected in the title of the ticket. No idea why the– lets call it effect – on my side was correlating with the update, not caused. It just unveilled the flaws of my code. The Zen of Python mentions error as an effect you should always publish as alert. My interpretation here is to share the impact. On the other hand, missing testing skills on my side wasted your rare time. Proper exception handling can unveil the context in detail. But we do not have these tools in Zotero itself. Your hint with the eta playground ist an instant feedback tool. Like a Jupyter Notebook can speed up development. But the trick is to insert the sample content like in your example. It is hard for the ignorant (me) to catch his ignorance because he is ignoring something. |
I don't mind the time, it's just that when I see a problem, I want to fix it, and if I don't understand the problem, I cannot fix it. BTW comma-separation is easier (IMO) with
and
|
THX, looks almost pythonic. I am used to Python String KungFu and Jinja2 templates, but as Donald Knuth said: "Premature optimization is the root of all evil" but I have no fear when the dark force rises. If I write my own translator I have to check for the suggested best practise for Zotero (including 7).
Hope this is not outdated, like other docs. I originally came up to use the BetterBibTeX offer to craft an eta-template, when getting into limitations while using csl. I am not remembering exactly the facts, but there were internal Zotero values from items seeming to be not reachable from the csl. The select item link magic was a blocker for me is my hunch. |
CSL discards a fair bit of information from the zotero items, but translators have all information. There's nothing 7-specific for translators, what works on 6 will work on 7 and vice versa. The doc you point to is still relevant. |
So I am leaving here finally, it was a pleasure. |
Debug log ID
S2M4W83X-refs-euc/6.7.160-6
What happened?
Note
After upgrading to BetterBibTex 6.7.160 my latest eta-template was not working like expected anymore. The day before it was OK!
Possible Cause:
it.items serialized from JSON were not seperated by parbreaks at the end of the nested output of the template.
The JSON l directly exported via BetterBibTeX json looked OK.
@retorquere Can you remember I had to work around differences between newlines and paragraph breaks to make it working for me in Logseq.
I am not sure if I need to change my template or something is missing in your update.
In any case it should not pass silently.
Example Export
In line 12 the next item starting at
- ### The Most Dangerous Writing App
is concatenated to the preceeding item without any delimiter.If the issue is on my side now (due to silly workarounds in the eta-template), I m happy to change the template on my side.
Originally posted by @acsr in #2789 (comment) (now with Debug log ID!)
The text was updated successfully, but these errors were encountered: