This repository contains the Zotero translation architecture code responsible for parsing Zotero translators and running them on live and static web pages to retrieve Zotero items.
A consumer of this repository needs to implement the following interfaces:
Zotero.Translatorsfound intranslators.jsZotero.HTTPfound inhttp.jsZotero.Translate.ItemSaverfound intranslation/translate_item.js
You also need to:
- Call
Zotero.Schema.init(data)with Zoteroschema.json. - Call
Zotero.Date.init(json)with the JSON fromutilities/resource/dateFormats.json - If running in a ModuleJS environment (e.g. Node.js) call
require('../utilities/cachedTypes').setTypeSchema(typeSchema)with the result ofutilities/resource/zoteroTypeSchemaData.js.
Please bundle translators and Zotero schema with the translation architecture. Do not load them from a remote server.
You may also want to reimplement or modify:
Zotero.Repofound inrepo.jsto set up periodic translator update retrievalZotero.Debugfound indebug.jsto customize debug loggingZoteroandZotero.Prefsfound inzotero.jsto set up the environment and long-term preference storageZotero.Translate.ItemGetterfound intranslation/translate_item.jsfor export translationZotero.Translate.SandboxManagerfound intranslation/sandboxManager.jsfor a tighter Sandbox environment if available on your the platform
See example/index.html for file loading order.
To run the example:
$ git submodule update --init
$ google-chrome --disable-web-security --user-data-dir=/tmp/chromeTemvarOpen example/index.html in the CORS ignoring Google Chrome