-
-
Save acsr/7fced5d3f238dc6180fcdb76c9f82803 to your computer and use it in GitHub Desktop.
<%- for (const item of it.items) { | |
const [ , kind, lib, key ] = item.uri.match(/^https?:\/\/zotero\.org\/(users|groups)\/((?:local\/)?[^/]+)\/items\/(.+)/) | |
const select = (kind === 'users') ? `zotero://select/library/items/${key}` : `zotero://select/groups/${lib}/items/${key}` | |
const relations = [] | |
if (item.relations) { | |
for (const [kind, rels] of Object.entries(item.relations)) { | |
for (const rel of rels) { | |
relations.push(rel) | |
} | |
} | |
} | |
-%> | |
- ### <%= item.title %> | |
<%- if (item.creators.length) { -%> | |
<%= "\n" %>creators:: <% item.creators.forEach((creator, i) => { %><%= creator.creatorType %>: <%= creator.name || `${creator.firstName || ''} ${creator.lastName || ''}`.trim() %><% if (i < item.creators.length - 1) { %>, <% } %><% }) %> | |
<%- } -%> | |
<%- if (item.url) { -%> | |
<%= "\n" %>url:: <%= item.url %> | |
<%- } -%> | |
<%- if (item.tags.length) { -%> | |
<%= "\n" %>tags:: <% item.tags.forEach((tag, i) => { %>#[[<%= tag.tag %>]]<% if (i < item.tags.length - 1){%>, <%}%><% }) %> | |
<%- } -%> | |
<%- if (item.citationKey) { -%> | |
<%= "\n" %>zotero:: [@<%= item.citationKey %>](<%= select %>) | |
<%- } -%> | |
<%= "\n" %> | |
<%- if (item.abstractNote) { -%> | |
<%= "\r" %> - #### abstractNote | |
<%="\r"%><%=item.abstractNote%> | |
<%- } -%> | |
<%- if (item.notes.length) { -%> | |
<%= "\r" %> - #### Notes | |
<%- for (const note of item.notes) { -%> | |
<%= "\r" %> - ##### Note [<%= note.key %>](<%= note.uri %> "URI Link") | |
<%~ note.note %> | |
<%- } -%> | |
<%- } -%> | |
<%- if (relations.length) { -%> | |
<%= "\r" %> - #### Relations | |
<%="\r"%> collapsed:: true | |
<%- for (const rel of relations) { -%> | |
<%= "\r" %> - <%= rel %> | |
<%- } -%> | |
<%- } -%> | |
<%- if (item.rights) { -%> | |
<%= "\r" %> - #### Rights | |
<%= "\r" %> - <%= item.rights %> | |
<%- } -%> | |
<% } %> |
Revision 11 adds a property collapsed:: true
after the Revisions list to collapse long lists by default. The actually broken link issue transformation remains unchanged but can be solved later.
Footgun: After pasting the markdown, Logseq does not take the collapsed property until a reindex of the page. (This can only be forced on per page basis by a workaround editing page the md file in a text editor (for new files: leave the page and come back. Then the page can be edited by the menu Open Page in default editor
once it is openend in a text editor add a minor one character edit, save, reverse the edit and save again. (Just touching is not enouch). Other tricks to reindex just this page are welcome.
This gist was experimentally cloned and I moved the revision states until and including revision 11 of this gist to a new public full fledged repo at https://github.com/acsr/Zotero-BetterBibTeX-QuickCopy-eta-template .
I am trying to preserve the comments in the new repo by migrating the comments from this gist to a discussion in the new repo. I successfully exported all the former comments as JSOn via the Github API
and using Github CLI
Why? I want to allow to manage the further development and even migration to another approach by an dedicated Issue Tracking workflow in this repo. Also the Wiki allows to add some illustrated examples and explain the use cases and limitation of this tool for others.
Revision 10 fixes an obsolete added leading space char in abstract notes (Rev 9 contained a remaining space too)