obsidian-citation-plugin icon indicating copy to clipboard operation
obsidian-citation-plugin copied to clipboard

Add template variables

Open hans opened this issue 5 years ago • 5 comments

  • [x] journal / book name (container-title in CSL I think)
  • [x] link to Zotero item
  • [ ] link to PDF
  • [ ] current date
  • [ ] short title

hans avatar Dec 10 '20 03:12 hans

I am currently using the zotero-mdnotes plugins and use the following variables, which I hope your plugin could support in the future:

  • Zotero Cloud Link
  • Authors as link [[Firstname Lastname]], [[Firstname1, Lastname2]]

Maybe for some date the Zotero database needs to be queried. Zothero, an Alfred plugin, does this. https://github.com/deanishe/zothero/blob/5b057ef080ee730d82d5dd15e064d2a4730c2b11/src/lib/zothero/zotero.py

mikebarkmin avatar Jan 08 '21 10:01 mikebarkmin

@mikebarkmin you could use the following handlebar statement in your template to get authors pre-rendered as links:

{{#each entry.author}}
[[{{given}} {{family}}]]
{{/each}}

SchmaR avatar Feb 03 '21 17:02 SchmaR

+1 request for current date. I don't know TS at all, but looking at the code I could probably implement this, if you accept pull requests.

Shamazo avatar Oct 05 '21 12:10 Shamazo

I got stuck trying to implement this (I have nearly 0 Node knowledge) Cloning the the master branch into my .obsidian/plugins, doing npm -i and then npm dev run I kept hitting this, even with nothing modified.

app.js:1 TypeError: Cannot read property 'entries' of undefined
    at OpenNoteModal.SearchModal.getItems (eval at <anonymous> (app.js:1), <anonymous>:14665:50)
    at OpenNoteModal.t.getSuggestions (app.js:1)
    at OpenNoteModal.t.updateSuggestions (app.js:1)
    at OpenNoteModal.t.onOpen (app.js:1)
    at OpenNoteModal.SearchModal.onOpen (eval at <anonymous> (app.js:1), <anonymous>:14627:33)
    at OpenNoteModal.e.open (app.js:1)
    at Object.callback (eval at <anonymous> (app.js:1), <anonymous>:85575:31)
    at EE (app.js:1)
    at e.executeCommandById (app.js:1)
    at e.onTrigger (app.js:1)

Shamazo avatar Oct 05 '21 13:10 Shamazo

Being able to add the current date to the template would be great!

dtafler avatar Apr 26 '23 13:04 dtafler