Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:translator_development_outside_scaffold [2010/07/24 16:56] – added tomrochewiki | dev:translator_development_outside_scaffold [2010/07/24 23:34] – more tomrochewiki | ||
---|---|---|---|
Line 35: | Line 35: | ||
=== Translator file location === | === Translator file location === | ||
- | Zotero installs its translators and related code as files in the subdirectory | + | Zotero installs its translators and related code as files in the subdirectory |
* if the path to your Firefox profile=< | * if the path to your Firefox profile=< | ||
* if the path to your Zotero=< | * if the path to your Zotero=< | ||
Line 44: | Line 44: | ||
At the highest level, a Zotero translator (for versions >= 2.0) consists of | At the highest level, a Zotero translator (for versions >= 2.0) consists of | ||
- | * a single [[translators_reference_guide# | + | * a single [[translators_reference_guide# |
* non-metadata code, consisting of | * non-metadata code, consisting of | ||
- | * a //detectWeb// function. This must return a string corresponding to a defined Zotero type. For a list of Zotero type names, see the values of the //itemTypes.//* properties in [[https:// | + | * a '' |
- | * a //doWeb// function. This actually writes an item corresponding to your web resource to your Zotero repository. | + | * a '' |
==== Translator development tools ==== | ==== Translator development tools ==== | ||
Line 58: | Line 58: | ||
===== Create or modify a translator file ===== | ===== Create or modify a translator file ===== | ||
+ | |||
+ | One can generate a completely new translator file using Scaffold 2.0. | ||
+ | - Start Scaffold. | ||
+ | - In tab=Metadata, | ||
+ | - In tab=Code, enter a '' | ||
+ | return " | ||
+ | } | ||
+ | </ | ||
+ | - Click on icon=Save (second from upper left). | ||
+ | - Check your translator filespace: you should have a new file with name based on field='' | ||
+ | - Close Scaffold. You may do all subsequent work directly on the new file. | ||
+ | |||
+ | However it is usually easier to create a new translator by copy/ | ||
+ | - working directly on an existing translator file (e.g. to fix a bug or add an feature) without modifying the '' | ||
+ | - " | ||
+ | - in the metadata block, | ||
+ | * create a new '' | ||
+ | * make the value of the '' | ||
+ | - in the code section, clear out any undesired contents from the '' | ||
+ | - somewhat " | ||
+ | - Find an existing translator with functionality that resembles what you want. | ||
+ | - Copy that to a new file in your translator filespace. | ||
+ | - Open the new file and | ||
+ | - change the metadata field='' | ||
+ | - assign a new value to field='' | ||
+ | - change the '' | ||
===== Edit, run, test, debug ===== | ===== Edit, run, test, debug ===== |