Creating Custom Link Handler

Asked by Shivam Sharma


I am creating a plugin to integrate Zim with Zotero, a reference manager. I am stuck at one place. I am able to add references in Zim.

Now, when I click on those references in Zim, I want to run a function which will open that reference in Zotero. So, e.g. the format of link that I have created is: `zotero://link/to/reference`. Clicking on this link should initiate a function in my plugin which opens up that reference in Zotero.

How can I create custom link handlers?

Question information

English Edit question
Zim Edit question
No assignee Edit question
Solved by:
Jaap Karssenberg
Last query:
Last reply:
Revision history for this message
Shivam Sharma (shivam-src) said :

The plugin is in working condition and available here: https://github.com/jaap-karssenberg/zim-wiki/wiki/Zotero-Plugin

Revision history for this message
Best Jaap Karssenberg (jaap.karssenberg) said :

You want to register an URL scheme with the main application object


Best way would be to have a extension in you plugin for the mainwindow and then call "window.gui.register_urk_handler()"

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

Thanks Jaap Karssenberg, that solved my question.

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

The plugin is functional and available here: https://github.com/shivams/zim-zotero-plugin

People using Zotero can test the plugin, and report any bugs. The functionality is very minimal, but I will soon add more features.