-
-
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 for QuickCopy struggles with iterating over relations
content
#2779
Comments
I need a debug log with the sample item in it for which this doesn't work -- right-click the item and send a debug log from the popup menu. The ID will have |
Debug Log ID with itemHere the requested Debug Log ID: YCGUKYR4-refs-euc/6.7.150-6 Offtopic
|
How many items (approximately) were in |
I can't replicate |
It's the most lightweight templating lib I could find, but any format that I would have chosen was going to be technical. It's always OK to ask. But |
I'm a little unclear on what it is you are asking and what is going on in this code. Can you just add or describe the output you want from the item in the (new) debug log rather than the code to produce it? |
I selected just one item and issued the log from the context menu of the item. during my first attempt there was a serious delay. The I started a second one but cancelled the sending (I remember it looks alike but was stuck at the end of the id, missing the UUID is at the start!) |
Rights is exporting to it.items to be accessed by eta! |
It is like/dislike your Jekyll/Hyde avatar. I love/hate this story (both sides) |
OK
I add here the raw markdown created for me and expected relations as a markdown list (the code in the first line of your quote can be omitted if the listing works. TODO (for me): Create a vanilla public Zotero group, invite @retorquere, copy over the cited item below, share the link here. Markdown result from the QuickCopy using my latest version of the eta-template (I added rights export and that works! (Content can be shared)additional: you see the notes exported as html entities (this is a different challenge (on my Jekyll side!) - ### #Fundstück: Schreibblockaden mit „The Most Dangerous Writing App“ überwinden
creators:: author: Florian Hagen
url:: https://www.tub.tuhh.de/tubtorials/2023/12/29/fundstuck-the-most-dangerous-writing-app/
tags:: #[[Schreiben]], #[[Writing]], #[[Online Tools]], #[[Tools]], #[[Writing Software]], #[[Writing Blog Posts]], #[[Text Creation]], #[[Schreibblockade]], #[[Manu Ebert]], #[[The Most Dangerous Writing App]]
zotero:: [@hagenFundstueckSchreibblockadenMit2023](zotero://select/groups/3305/items/B6IC7QKD)
- #### abstractNote
„The Most Dangerous Writing App“ ist ein Open-Source-Tool, das mit Hilfe von Free Writing helfen kann, Schreibblockaden zu überwinden.
- #### Notes
- ##### Note [I5D5Z24J]( http://zotero.org/groups/3305/items/I5D5Z24J "URI Link")
<div data-schema-version="8"><pre>In der Kategorie ‚Fundstück‘ werden Tools, Services und andere Entdeckungen rund um den <a href="https://www.tub.tuhh.de/tubtorials/2019/08/10/wissenschaftliche-kommunikation-ein-individueller-kreislauf/" rel="noopener noreferrer nofollow">life cycle wissenschaftlicher Kommunikation</a> in kurzen Texten vorgestellt.</pre>
</div>
- ##### Note [GJ9E72RG]( http://zotero.org/groups/3305/items/GJ9E72RG "URI Link")
<div data-schema-version="8"><h2><strong><span style="color: rgb(34, 34, 34)"><span style="background-color: rgb(255, 255, 255)">„The Most Dangerous Writing App“ – Was ist das?</span></span></strong></h2>
<p><span style="color: rgb(17, 17, 17)"><span style="background-color: rgb(255, 255, 255)">Die&nbsp;</span></span><span style="color: rgb(34, 119, 187)"><span style="background-color: rgb(255, 255, 255)"><a href="https://maebert.github.io/themostdangerouswritingapp" rel="noopener noreferrer nofollow">originale Open-Source-Variante</a></span></span><span style="background-color: rgb(255, 255, 255)">&nbsp;von „The Most Dangerous Writing App“ wurde von Manu Ebert veröffentlicht. Zu dieser gibt es auch ein&nbsp;</span><span style="color: rgb(34, 119, 187)"><span style="background-color: rgb(255, 255, 255)"><a href="https://github.com/maebert/themostdangerouswritingapp" rel="noopener noreferrer nofollow">GitHub-Repositorium</a></span></span><span style="background-color: rgb(255, 255, 255)">. Zusätzlich gibt es eine leicht angepasste Variante, die über&nbsp;</span><span style="color: rgb(34, 119, 187)"><span style="background-color: rgb(255, 255, 255)"><a href="https://www.squibler.io/dangerous-writing-prompt-app" rel="noopener noreferrer nofollow">Squibler</a></span></span><span style="background-color: rgb(255, 255, 255)">, einer KI-Plattform zur Unterstützung von Schreibenden, angeboten wird. Unabhängig von der gewählten Version setzen beide auf den Free-Writing-Ansatz, um Schreibblockaden zu überwinden.</span></p>
</div>
- #### Relations
- [object Object]
- #### Rights
- CC BY 4.0 rendered similar to
creators:: author: Florian Hagen
|
Can you give me a sample of what you actually want as output? |
Done: I invited emilianoeheyns to my public closed group: zotero://select/groups/5387086/collections/TSYLQ2FT |
Or is the yaml you posted the actual output you want? |
it is not YAML but the Markdown indentation necessary for my Logseq insert via clipboard. just: four space characters, one dash, another space, the url contained in the relation list for Relations the raw Markdown copied to the clipboard should be for now exactly matching the JSON content payload like: …
- #### Relations
- http://...
- http://...
- http://...
… And of course in the end with proper https |
@retorquere I invoked a new debug log from the whole test group library (right click on the group, |
You can right-click a single item and send a log for that. |
Can you invite |
When I re-export |
I created a single Item log as well: VE2Q5ULE-refs-euc/6.7.150-6 |
It's not a typo, |
I am sure exporting as BetterBibTeX JSON! I could not find any entries where export fields can be included excluded except the exclude option in Better BibTeX prefs, but it is empty. |
Please don't do this. That ID is the ID of the translator; it is the same for everyone and there are exactly zero privacy aspects to this. It makes my life harder if people corrupt files to debug stuff with. The file won't import with the translatorID altered. I also don't understand what you mean that "rights is missing". It is right there on line 113. wrt the eta template, this works for me:
|
That is for the Better CSL/YAML/BibTeX/BibLaTeX exports only. |
The full translator id is:
I completely apologize. It could be banner blindness and no idea why I did not find it before. I remember that I double checked it. Otherwise I would not have mentioned it here. I just wanted to share the expected additional issue, but is was fata morgana.
Looks much cleaner, template code layout like this was beyond my former skills.
One big thank you here for now! Are you interested in providing the final example for your published docs? Or is there a suggested place for a stackoverflow like place to share that (the Zotero forum is not suitable for code markup). I am looking forward for sharing my workflow in the Logseq ecosphere and then can be linked by you from there without any support expectations for you included. |
I tested the eta-template code example provided by you above (whole code copied using github button! only snippet cited here for reference): snippet for relations: …
- #### Relations
<%- for (const rel of item.relations) { -%>
- <%= rel %>
<%- } -%>
<%- } -%>
<%- if (item.rights) { -%>
… I got
|
Ja I know as it is the same for everyone 😄 but I import these test files (that's what the format is for) and I'd rather not have to make manual fixes if there's no benefit.
You're welcome
The pencil at the top right of the site pages let you make suggestions for changes to the site.
I think the site is fine for that |
Looks as expected inserted in Logseq with the new code, when I remove the relations. Example as screenshot.
ToDo:
My next steps are enhancing it for attachments and pdf annotation links. Here is my latest comment on this topic in a thread targeting PDF links. |
You can't see these relations yet in BBT JSON, but they're present. A new BBT is building where BBT JSON will show these relations. |
OK, I see this leads to forking the repo and create a pull request. I am familar with this and Hugo and hopefully find the time. One more thingI have a suggestion for the search in your docs. Even when AI based searchengines are under way, there is a cool free solution to improve your search using https://docsearch.algolia.com/. It is free for opensource project docs and does a cool job making your docs search much more helpful. You can see it in use here, where I implemented it for a Sphinx-doc based project: https://userguide.present4d.com We used it for Plone as well, but we now in transition to an AI based search using https://nuclia.com/ |
I am looking forward to your new release and you may please wait with closing this issue until I have tested it. In my JSON (included above) export some Relations were there (see my export), but I failed to serialize the object in my original case using the eta-template. This is maybe of the simple list I had instead of a dictionary. Now I have something different here: …
"relations": {
"owl:sameAs": [
"http://zotero.org/groups/3305/items/GJ9E72RG"
]
},
… in my original export I had relations like this in the JSON Export: …
"relations": [
"http://zotero.org/groups/3305/items/HPSPXE2V",
"http://zotero.org/groups/3305/items/IUXZMUYM",
"http://zotero.org/groups/3305/items/K69CGHDJ"
],
… Important: I forgot that relations are gone when copying items to another group, and need to be recreated and: The targets have to be there as well! I will now recreate the relation in the test group as well. New insightInteresting is the |
This is the part that is changing in the new build. |
Update: here is the snipped from the JSON export …
"relations": [
"http://zotero.org/groups/5387086/items/E6Q3V4RB",
"http://zotero.org/groups/5387086/items/IQ438J55",
"http://zotero.org/groups/5387086/items/Y428Z85I"
],
… With your latest code from The Relations part now looks like this in Logseq: The last one ending with |
6.7.164 will show the relations in the BBT JSON output unchanged from the internal format. |
Thank You! Special relation to origin of items copied from other groups/libraries
I really like to have this origin link, but to make the relations more useful, we need to enrich the context. Remark on the special relation: Maybe this is used to deduplicate the copy and original in a copy on write manner and speed up the processes in the background to move a copy to the new group. Since this unofficial, we cannot rely on this. eta-template gist updatedI updated my eta-template in the gist based on the example privded by @retorquere here to revision 6 and remode the broken wip version. https://gist.github.com/acsr/7fced5d3f238dc6180fcdb76c9f82803 Unfortunately I could not preserve the nice indentations by @retorquere (for now) due to the fact, that I need more control over linefeed and newline when pasting in Logseq and have to set them explicitly instead of reusing the line delimiters and whitespace of the template defaulting to unicode dec10 in some cases. Otherwise indentation gets corrupted by the Logseq clipboard preprocessor. result in Logseq looks like this now: How to debug the preprocessed JSONTo debug the eta-template output you can add [[[<%~ JSON.stringify(item) %>]]] after line 13 of the eta template, below the initialization of the items to iterate over them. You then get a perfixed output similar to the screenshot in the comment above. StatusFor me we can
Off this topic:I started a discussion issue on this in the Zutilo Plugin and the pitfalls of recursive relation (Goal was to set a selection or filter to get related items in the Zotero items list. One challenge: what if multiple items are selected and how to treat recursion depth of relations) |
Debug log ID
EKF7WRXW-euc/6.7.150-6
What happened?
I am using an extended eta-template to export Zotero entries as markdown to paste an item into my Logseq.com PKM.
During the processing of related items I am not able to serialize the content of a list of related urls.
I host my current development version eta-template publicly as gist here: https://gist.github.com/acsr/4be9b01cc2c989519c497ee87510f9a4
I am testing the template with an Zotero item with 3 relations urls.
When I export the item via BetterBibTeX as JSON, the relations are included.
(by the way: rights field is missing in the JSON, but that needs to rise a different issue)
Any ideas by users how to fix this, or a better place to ask the community.
Template Code:
The text was updated successfully, but these errors were encountered: