Zotero plugin for DokuWiki

For managing my literature sources for reference lists I use Zotero and I really like it. It is a plugin for Firefox and supports synchronizing the database and the attachments to an online server. The only thing that was missing was a way to cite my sources from inside my DokuWiki. I wanted to be able to add citations to my texts like I do in LaTeX.

For this reason I created a plugin for DokuWiki that allows me to cite sources from my online Zotero database by using the syntax known from LaTeX. The plugin reads my reference list from the Zotero website and caches it on a local wiki page. After that I can cite a source simply by adding \cite{ShortName}. Take a look at my wiki (e.g. Programming Hints) for some examples.

DokuWiki Zotero Plugin 02
DokuWiki Zotero Plugin 01

For this to work, every source needs to have a short name as I did not want the cite key to be the Zotero ID but rather a more meaningful name. Almost every Zotero entry type has the field “short name” assigned to it so I used that for this purpose.

Here is an example of the steps to perform to be able to cite a Zotero source:

  1. I add a new entry to my Zotero database, e.g. Robert Martin: Clean Code (2008) and assign the short name Martin2008 to it.

    DokuWiki Zotero Plugin 04
  2. I synchronize my Zotero database with the Zotero server (because the plugin reads the data from the Zotero website).
  3. I write some text in my wiki and add \cite[p.123]{Martin2008}.
  4. I preview or save the current wiki page and the plugin tries to find the cited reference in its local cache and displays it. If the entry is not already in the cache, it automatically loads my newest Zotero sources from the website, caches them, and displays the cited source afterwards.

For the initial import of all my Zotero entries I added a script that parses the complete reference list on the Zotero website.

DokuWiki Zotero Plugin 03

Download

The plugin can be downloaded here: Download DokuWiki Zotero plugin or installed via the plugin manager.

Also see the DokuWiki Plugins page: zotero plugin.

Please see Install.txt for a short installation guide.

Über Stefan

Polyglot Clean Code Developer

7 Kommentare

  1. Pingback:Tweets that mention Zotero plugin for DokuWiki » Stefan Macke -- Topsy.com

  2. Great plugin, thanks.

    I’d love to be able to refer to a group library, and not only that of an individual. What changes would that require?

    B

  3. @Bertrand: At the moment the plugin does not work as expected at all, because Zotero changed its site structure (on which the plugin relies). But changing from a single library to a group library should not be that much of an effort as the plugin contains a “website reader” which does all the work. This should be the only component that may need a change.

  4. Do you have any plans as to updating your plugin to make it work with the current zotero website? besides, even if the website changed there have been no changes in the API… could you do it work through the API rather than the web pages?

    Thanks for your answer!

  5. @Betrand: I am planning an update indeed, as I need the plugin to work again myself. But I don’t know when I will find the time. I think during the next two weeks it may be possible.

  6. I made the following changes to get the plugin to work on the latest zotero.

    1) ZoteroParser.php

    line 62

    $table = preg_replace( "/&(?!amp;|gt;|lt;|quot;)/", "", $matches[0] );//html_entity_decode(stripslashes($matches[0]));//$matches[0];

    2) ZoteroWebsiteReader.php

    line 116

    $pattern = "/[^\/]*$/";// "/.*\/([0-9]+)/"; Note: This is a change by Tim M. April 8, 2011

    line 122

    if ($id == "") //0)
  7. Hi Tim. Thanks for the changes!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax