Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:scaffold [2009/06/29 01:55] – Kansas Is Going Bye-Bye (removed translator how-to, too much duplication with other sources) rmzelle | dev:scaffold [2018/05/07 13:09] (current) – bwiernik | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Scaffold - an IDE for Zotero translators ====== | + | See [[dev/translators/ |
- | + | ||
- | Scaffold is a Firefox extension developed to simplify writing Zotero translators. In Zotero 1.0.x, translators are stored in a single SQL database. Scaffold makes it easy to extract translators from this database, to edit and test translator code, and to save changes back into the database. | + | |
- | + | ||
- | ===== Installation ===== | + | |
- | + | ||
- | [[/download/ | + | |
- | + | ||
- | **Please note:** As of yet, Scaffold is only compatible with Zotero 1.0.x. Users of Zotero 2.0 can edit translators directly, as in that version translators are stored as individual text files in the ' | + | |
- | + | ||
- | ===== Interface ===== | + | |
- | + | ||
- | After installation, | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | ==== Top buttons ==== | + | |
- | + | ||
- | {{: | + | |
- | Opens the "Load Translator" | + | |
- | + | ||
- | {{: | + | |
- | Saves the translator you are currently working on to the database. Be sure to provide a unique label and Translator ID for your translator if you don't want to overwrite the existing translator. Translator IDs can be automatically generated via the " | + | |
- | + | ||
- | {{: | + | |
- | This copies the entire translator to the clipboard. The translator is formatted as an SQL statement so it can be inserted into scrapers.sql (the Zotero 1.0.x database containing all translators). | + | |
- | + | ||
- | {{: | + | |
- | Saves and runs translator code on the webpage loaded in the most recently selected tab. The exact behavior depends on the selected Scaffold tab. If the " | + | |
- | + | ||
- | ==== Tabs ==== | + | |
- | + | ||
- | **Metadata** \\ Here you provide metadata of the translator. Translator IDs can be automatically generated via the " | + | |
- | + | ||
- | **Detect Code** \\ The text-field of this tab should contain the detectWeb function for web translators, | + | |
- | + | ||
- | **Code** \\ The text-field of this tab should contain the doWeb function for web translators, | + | |
- | + | ||
- | ==== Debug Output ==== | + | |
- | + | ||
- | One of the strengths of Scaffold is its ability to provide you with immediate feedback, which can dramatically speed up translator development. After a code change, a single click suffices to run the modified translator and generate debug output. For each of the three tabs of Scaffold, a different type of debug output is generated: | + | |
- | + | ||
- | === Metadata === | + | |
- | When the "Test Regex" button in the Metadata tab is clicked, the regular expression in the target field is applied to the webpage loaded in the most recently selected Firefox tab. The debug window at the bottom of the Scaffold window will show whether the regular expression matches ('' | + | |
- | + | ||
- | < | + | |
- | 09:54:11 ===> | + | |
- | </ | + | |
- | + | ||
- | === Detect Code & Code === | + | |
- | + | ||
- | When the execute button is clicked while the " | + | |
- | + | ||
- | Debug output for the " | + | |
- | + | ||
- | < | + | |
- | 19:19:43 detectCode returned type " | + | |
- | </ | + | |
- | + | ||
- | Debug output for the " | + | |
- | + | ||
- | < | + | |
- | 19:24:21 Returned item: | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | + | ||
- | 19:24:21 Translation successful | + | |
- | </ | + | |
- | + | ||
- | If running detectWeb or doWeb results in an error, the debug window will show an error message. | + | |
- | + | ||
- | Note that additional debug output can be generated by the javascript command '' | + | |
- | + | ||
- | === Test Frame === | + | |
- | + | ||
- | FIXME What is the purpose of the Test Frame drop-down menu? | + | |
- | + | ||
- | ===== Getting your translator distributed ===== | + | |
- | + | ||
- | If your new or modified translator has general appeal, consider posting the translator to the [[http:// | + | |
- | + | ||
- | refer to http:// | + | |
- | + |