A Zotero plugin adding citation metadata support, with back and forth communication to WikiData, citation extraction from file attachments, and local citation network visualization.
Note: until #247 is fixed please change your language setting in Zotero (Edit -> Preference -> Advanced -> Miscellaneous) from
English
to a variant (such asEnglish (UK)
orEnglish (Canada)
) for Cita to work correctly!
Initial development of this plugin was supported by a grant from the Wikimedia Foundation.
The plugin consists of four separate basic modules:
This module adds citation metadata support to Zotero. It provides an additional Citations tab where the user can:
Citations metadata are currently saved as a note attachment.
This module provides back and forth citation syncing with WikiData, using property P2860 "cites work".
This module allows visualizing how items in a local library connect to each other through citations, using Tim Wölfle's Local Citation Network.
This module will send file attachments to local or remote citation extraction services (e.g., Grobid, Scholarcy) and retrieve parsed citations from them.
Download the latest XPI and install it in Zotero.
Quickstart guide available at Wikidata's Cita page.
Cita is collaboratively translated at translatewiki.net. Would you like to help translate it to other languages? Join the translation project here!
git submodule update --init --recursive
to fetch the nested submodules.npm install
npm run build
, or npm run watch
to rebuild
automatically each time the source code is changed. Built files will be saved to dist/chrome/content
.dist
directory.-p <Profile>
: runs Zotero with a custom development profile to avoid breaking your personal library-purgecaches
: forces Zotero to re-read any cached files-ZoteroDebugText
: prints the debug output to the terminal window-jsconsole
: opens a basic JavaScript debug console; this is not necessary if you be debugging
using your browser (see below), but it may help you detect early errors without having to open
the developer toolsdist
directory into a ZIP file and change its extension to .xpi
./package.json
/static/install.rdf
em:updateURL
depending on beta/full releaseversion
and updateLink
s in /update.rdf
or ./update-beta.rdf
(for the beta release).git clean -xdf
to remove untracked files, including /dist
and /node_modules
.npm install
. This will also update /package-lock.json
with the new version.npm run build
to build the plugin./dist
into a zip file named zotero-cita-vX.Y.Z.xpi
. E. g. cd dist && zip -r ../zotero-cita-v0.0.1.xpi *
git commit -m "Bump vX.Y.Z"
and git push
.git tag vX.Y.Z
and git push --tags
.To debug, you need to build Zotero with debugging support. Follow the instructions here to:
-t
option.-debugger
flag: staging/Zotero_linux-x86_64/zotero -debugger ...
. This runs the Mozilla DevTools server
on port 6100, which you can connect to from Firefox Developer Tools.--new-instance
flag in case you have another Firefox
instance running, and the -p <Profile>
flag to use a separate profile for this version.[1] Before building, making these changes to the Zotero source code might help you with debugging:
sourceMaps: "inline"
key:value pair to the .babelrc
configuration file.Zotero.debug()
that you will find in the
Zotero.Notifier.trigger
function inside chrome/content/zotero/xpcom/notifier.js
. Make sure you are running
Zotero with the -ZoteroDebugText
flag (see previous section).[2] To prevent your downloaded Firefox version from upgrading to a newer version, you have to disable automatic updates:
-P
flag to open the Profile Manager.about:config
and set app.udpate.auto
to false
.-P <ProfileName>
flag.The reason why the setting must be changed using your system Firefox is because it seems that Firefox checks for updates on startup, before one can change the setting. And if an update is found, it will be applied on next start, irrespective of this setting's value, overwriting the version you downloaded.
[3] Unfortunately the developer tools are closed automatically when the Zotero client is closed. Therefore, each time a change is made to the plugin, the Zotero client must be restarted, and the developer tools have to be opened again. If someone knows of a way to prevent developer tools from closing and reconnect when connection is available again, or to have them open automatically via console, so it can be run immediately after Zotero, please let me know!
Cita depends on:
Support for importing/exporting citations from/to a file, among other contributions, were mostly implemented by Dominic DallOsto.
Copyright (C) 2022 Diego de la Hera, Dominic Dall'Osto, and contributors.
This work is released under the terms of GPL-3.0 or any later version.
It has been suggested that new Zotero plugins be written as bootstrapped extensions rather than XUL overlay extensions, to facilitate them being ported to a future non-Mozilla version of Zotero. As suggested elsewhere, Will Shanks' Zutilo plugin was used as an example of an existing bootstrapped extension to write some parts of this plugin.
Doing anything new in XUL has also been strongly recommended against, and using standard React/HTML has been suggested instead (see here, or here). For these cases, some inspiration has been borrowed from already reactified components in Zotero's source code.