Zim

plugin to interact with zotero

Asked by Rudi Bruchez

Hello,

I start using zim as my main tool to keep notes, and I'm thinking about a way to link a page to a zotero (reference management software working on top of Firefox) entry, ie a reference for citations.

I'm starting to have a look at the plugins already developed, that gives me what's needed to start. For interacting with zotero, someone has already done a similar thing in python / GTK : http://www.cogsci.nl/software/gnotero.

I still have 2 questions to go :
1/ is it possible by plugin to add some formatting to an element, like it's done for the tag entries. I could think about a tag similar to this: [ZOTERO: a reference id|Author, Title of the book], that would be displayed nicely in zim and would open the zotero reference with a click.

2/ is it possible by python code to open a specific page in zim, in order to backreference a page from a zotero reference, in order to keep track of notes made on it ?

thanks a lot,
Rudi

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Rudi Bruchez
Solved:
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

On Tue, May 17, 2011 at 2:35 PM, Rudi Bruchez <
<email address hidden>> wrote:

> I still have 2 questions to go :
> 1/ is it possible by plugin to add some formatting to an element, like it's
> done for the tag entries. I could think about a tag similar to this:
> [ZOTERO: a reference id|Author, Title of the book], that would be displayed
> nicely in zim and would open the zotero reference with a click.
>

I would suggest using a specific url scheme for these links instead of a
special format element. As a shortcut you could use the "interwiki" syntax.
So it would become:

  [[zotero://a_reference_id|Author, Title, some other text]]

or

  [[zotero?a_reference_id|Author, Title, some other text]]

At the moment no direct way for a plugin to hook into that url, but this can
be easily added to zim. Thus the plugin would just provide the command to
execute when a user clicks one of these links.

If you file a bug report for this, I'll add the hook in a week or two (will
be offline for the next week).

2/ is it possible by python code to open a specific page in zim, in order to
> backreference a page from a zotero reference, in order to keep track of
> notes made on it ?
>

Sure, just call "zim notebook page" and it will open the notebook on that
page. On linux it also supports this for notebooks that are open already.

-- Jaap

Revision history for this message
Rudi Bruchez (rudi-babaluga) said :
#2

Thanks for the answer, you're right, an URL is the best solution. And Zotero already support this as a link to a reference, through firefox. I'll create a bug report for adding the hook, then I'll do the rest in the plugin.

thanks,
Rudi

Revision history for this message
sybille (sybillel) said :
#3

Hi,

I'm a user of both Zim and Zotero and I'd love to be able to integrate Zotero references into Zim pages, with the ultimate dream of having them work in an ODT document if and when it becomes possible to export from Zim to that format.

For now, I've discovered that it is possible to link to a Zotero attachment (as opposed to a Zotero reference) in Zim. Note that I'm still using Lucid, with Gnome 2 and Firefox 3.6.17, plus Zotero 2.1.7 and Zim .52. I have no idea how this might be different under Gnome 3.

I've set up an url-handler in Gnome for zotero:// links, using the following commands:
gconftool-2 -t string -s /desktop/gnome/url-handlers/zotero/command "firefox %s"
gconftool-2 -t bool -s /desktop/gnome/url-handlers/zotero/enabled true
gconftool-2 -t bool -s /desktop/gnome/url-handlers/zotero/needs_terminal false

That will instruct Gnome to open links beginning with zotero:// in Firefox. To test, view a Zotero attachment in Firefox and note the URL in the Firefox address bar. Then, from a terminal, run firefox with the URL of the attachment, as in:
firefox zotero://attachment/XXXX/ (using the URL you noted).
The attachment document should open in Firefox, using the appropriate plugin as necessary (I use evince with mozplugger for PDF and DJVU files in Firefox). If the Zotero attachment is a web page, it's possible to send clippings from Firefox to Zim with zimcapture extension, and it uses the zotero:// link in the resulting clipping in Zim.

So I thought you might be interested in that solution. However, it would be fantastic to have more of a gnotero-type access to the references themselves rather than just to the attachments as in this method.

Revision history for this message
Hans Fast (fasthans) said :
#4

I would love to see a plugin that can handle two-way traffic with zotero (zotero's note-taking functionality just doesn't cut it compared to a full wiki). If you do write one, let us know.

Hans

Revision history for this message
Shivam Sharma (shivam-src) said :
#5

A very simple plugin for Zotero integration has been developed by me: https://github.com/shivams/zim-zotero-plugin

You can insert references in Zim pages from Zotero, and then open them later by clicking on them in Zim. See, if this serves the purpose and suggest some additions to the plugin.