Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
dev:translators:scaffold [2014/12/12 16:33] – [Installation] Update install link (in previous edit and here) aurimas | dev:translators:scaffold [2023/01/30 09:02] – [Top buttons] boconnell | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Scaffold - an IDE for Zotero translators ====== | ====== Scaffold - an IDE for Zotero translators ====== | ||
- | Translators are stored as individual JavaScript files in the " | + | Translators are stored as individual JavaScript files with additional metadata at the top and tests at the bottom |
Scaffold supports editing and testing web translators and import translators. Search and export translators can not yet be tested using the IDE. | Scaffold supports editing and testing web translators and import translators. Search and export translators can not yet be tested using the IDE. | ||
- | ===== Installation ===== | ||
- | * [[https:// | ||
- | Scaffold 3 includes support for the [[dev: | ||
- | Scaffold does not run in Zotero Standalone. | ||
- | |||
- | **Note:** Scaffold will not work correctly when Zotero Standalone is open, as Zotero in Firefox will switch to " | ||
===== Interface ===== | ===== Interface ===== | ||
- | After installation, | + | Scaffold is available via Tools → Developer → Translator Editor |
+ | |||
+ | When you first open Scaffold, you'll need to select your translator development directory. In most cases, | ||
+ | |||
+ | After selecting your translator directory, | ||
- | {{:dev:scaffold2.0-metadata.png?640& | + | {{:dev:translators: |
==== Top buttons ==== | ==== Top buttons ==== | ||
- | {{: | + | {{: |
Opens the "Load Translator" | Opens the "Load Translator" | ||
Line 27: | Line 25: | ||
Saves the translator you are currently working on. Provide a unique label and translator ID for your translator if you don't want to overwrite an existing translator. New translator IDs can be automatically generated via the " | Saves the translator you are currently working on. Provide a unique label and translator ID for your translator if you don't want to overwrite an existing translator. New translator IDs can be automatically generated via the " | ||
- | {{: | + | {{:dev: |
- | Saves and runs the '' | + | Saves the translator you are currently working on and writes it to the " |
+ | |||
+ | {{: | ||
+ | Saves and runs the appropriate '' | ||
+ | * If it's a web translator and a page is loaded in the Browser tab: '' | ||
+ | * If it's an import translator and data has been entered in the Test Data tab: '' | ||
+ | * If it's a search translator and a JSON search object has been entered in the Test Data tab: '' | ||
+ | |||
+ | {{: | ||
+ | Saves and runs the appropriate '' | ||
+ | * If it's an export translator and an item is selected | ||
- | {{: | ||
- | Saves and runs the '' | ||
==== Tabs ==== | ==== Tabs ==== | ||
Line 37: | Line 43: | ||
**Metadata** \\ Shows the translator metadata. Translator IDs can be generated via the " | **Metadata** \\ Shows the translator metadata. Translator IDs can be generated via the " | ||
- | **Code** \\ The text box in this tab contains the translator' | + | **Code** \\ The text box in this tab contains the translator' |
- | {{: | + | **Tests**\\ This tab contains the list of tests saved in the translator, as well as the raw JSON and expected output for each one. You can run or update tests from here. Create tests from the corresponding tab for the type of test you want to create (Browser or Test Data). |
+ | |||
+ | **Test Data** \\ Input data for import and search translators. | ||
+ | |||
+ | **Browser**\\ View sites and test detection and data extraction. | ||
==== Debug Output ==== | ==== Debug Output ==== | ||
Line 46: | Line 56: | ||
=== Metadata === | === Metadata === | ||
- | When the "Test Regex" button in the " | + | When the "Test Regex" button in the " |
< | < | ||
Line 95: | Line 105: | ||
If running '' | If running '' | ||
- | ===== Import Translators ===== | + | ===== Import, Export, and Search |
- | Starting with version | + | Starting with version |
In the translator load window, import translators are arranged in alphabetical order at the bottom of the list. | In the translator load window, import translators are arranged in alphabetical order at the bottom of the list. | ||
- | **Note:** The screenshots on this page do not reflect the changes made in Scaffold 2.1.2 to add support for import translators. | ||
===== Scaffold Troubleshooting ===== | ===== Scaffold Troubleshooting ===== | ||
- | * **Why does my translator work in Scaffold but not when I click on the address bar icon in my browser?** | ||
- | Scaffold runs the functions '' | ||
- | This can differ from the active | + | **Why does my translator work in Scaffold but not when I click the Save to Zotero button in my browser? |
+ | Scaffold runs the functions '' | ||
+ | |||
+ | These results can differ | ||
+ | |||
+ | **Why won't my attachments save?** | ||
+ | |||
+ | The output pane in Scaffold shows the item object as Zotero is about to save it. It does not in fact save the object. | ||
+ | |||
+ | **Why do some fields show in the output pane but not in the created item?** | ||
+ | |||
+ | As an item is saved, the contents of some fields may change. | ||
+ | |||
+ | The attachment information in the output pane of Scaffold merely says what Zotero is going to try to save; as the attachments are saved, they may be discarded if their actual content type differs from the one specified, as can happen when PDFs or other attachments are hidden by providers behind an interstitial terms or copyright notice page. | ||
- | * **Why won't my attachments save?** | + | Fields that are not allowed for the specified |
- | * **Why do some fields show in the output pane but not in the created | + | |
- | The output pane in Scaffold shows the item object as Zotero is about to save it-- it does not in fact save the object. As an item is saved, the contents | + | |
- | The attachment information in the output pane of Scaffold merely says what Zotero is going to try to save; as the attachments are saved, they may be discarded if their actual MIME type differs from the one specified, as can happen when PDFs or other attachments are hidden by providers behind an interstitial terms or copyright notice page. | + | ====== Further Reading ====== |
- | Fields that are not allowed for the specified item type will be discarded, even if they show up in the output pane of Scaffold. | + | More detailed instructions |