Skip to content

Latest commit

 

History

History
92 lines (58 loc) · 6.17 KB

README.md

File metadata and controls

92 lines (58 loc) · 6.17 KB

Cita: a Wikidata addon for Zotero

Using Zotero Plugin Template

A Zotero plugin adding citation metadata support, with back and forth communication to WikiData, citation extraction from file attachments, and local citation network visualization.

Initial development of this plugin was supported by a grant from the Wikimedia Foundation.

Description

The plugin consists of four separate basic modules:

Citation metadata support

This module adds citation metadata support to Zotero. It provides an additional Citations tab where the user can:

  • add, edit or remove individual citations;
  • run item-wide and citation specific actions, such as syncing citations with WikiData, parsing citations from attachments (not yet supported), etc;
  • edit source item's UUIDs, such as DOI, WikiData's QID, and OpenCitations Corpus ID.

Citations metadata are currently saved as a note attachment.

WikiData communication

This module provides back and forth citation syncing with WikiData, using property P2860 "cites work".

Local Citation Network visualization

This module allows visualizing how items in a local library connect to each other through citations, using Tim Wölfle's Local Citation Network.

Citation extraction (to be developed)

This module will send file attachments to local or remote citation extraction services (e.g., Grobid, Scholarcy) and retrieve parsed citations from them.

Installation

Download the latest XPI and install it in Zotero.

Quickstart guide

Quickstart guide available at Wikidata's Cita page.

Translation

Cita is collaboratively translated at translatewiki.net. Would you like to help translate it to other languages? Join the translation project here!

Development

  1. Download a beta version of Zotero from here - these come with the debug tools already enabled so you don't need to build it from source.
  2. Install nodejs and npm if you don't already have them (Currently Node v18 and npm v8.1 are the minimum required versions)
  3. Clone the source code git clone https://github.com/diegodlh/zotero-cita, and run git submodule update --init --recursive to fetch the nested submodules.
  4. Setup the plugin to run with the debug version of Zotero
    1. Make a new file in the repo root called .env (you can also copy an example .env file from here)
    2. Add a line in .env like ZOTERO_PLUGIN_ZOTERO_BIN_PATH = <path-to-your-zotero-binary> to point to the executable of the Zotero debug build you downloaded in step 1.
    3. Add a line in .env pointing to the Zotero profile you will be using: ZOTERO_PLUGIN_PROFILE_PATH = <path-to-your-zotero-profile-folder> (ideally, create a new Zotero profile for debugging). For me the folder is called 3vvlvf75.debug. Instructions on how to find this folder can be found here
  5. Run npm install
  6. This plugin is built using esbuild. Run npm run start to launch Zotero and rebuild the plugin automatically each time the source code is changed (thanks to zotero-plugin-scaffold). For some changes like CSS the hot reloading doesn't work and you will need to restart Zotero. Built files will be saved to build/addon/chrome/content.
    1. The firefox debug tools should automatically pop up, allowing you to see console output, debug code, and edit CSS. Most code should be visible under file:// in the debugger
  7. For distribution, run npm run build, then you can find the extension at build/zotero-cita.xpi.

Publishing

  1. Decide a new version number vX.Y.Z using Semantic Versioning, and depending on whether it's a beta release or not.
  2. npm run release and choose this version number and the version will be automatically bumped in package.json and the release tagged. This will trigger github actions to build the code and make a new release at this version
  3. Until integration tests have been implemented (#30), install the new version on a fresh Zotero profile and run some manual tests.

Acknowledgements

Cita depends on:

Support for importing/exporting citations from/to a file, among other contributions, were mostly implemented by Dominic Dall'Osto.

License

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.

Cita for Zotero 7 was based on windingwind's zotero plugin template, while previous versions were based on Will Shanks' Zutilo 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.