Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:translators:scaffold [2022/11/24 04:05] – [Debug Output] dstillmandev:translators:scaffold [2024/04/26 06:57] (current) – [Scaffold - an IDE for Zotero translators] dstillman
Line 1: Line 1:
 ====== Scaffold - an IDE for Zotero translators ====== ====== Scaffold - an IDE for Zotero translators ======
  
-Translators are stored as individual JavaScript files with additional metadata at the top and tests at the bottom in the "translators" subdirectory of the [[:zotero_data|Zotero data directory]]. While translators can be edited with any tool, Scaffold is dedicated to writing Zotero translators, offering advantages such as real-time testing and debugging.+[[dev:translators|Translators]] are stored as individual JavaScript files with additional metadata at the top and tests at the bottom in the "translators" subdirectory of the [[:zotero_data|Zotero data directory]]. While translators can be edited with any tool, Scaffold is dedicated to writing Zotero translators, offering advantages such as real-time testing and debugging.
  
 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.
Line 19: Line 19:
 ==== Top buttons ==== ==== Top buttons ====
  
-{{:dev:load.png?nocache&nolink|}} **Load** \\ +{{:dev:load.png?nocache&nolink|}} **Open** \\ 
 Opens the "Load Translator" window. Select one of the currently installed translators, and load the translator metadata and code into Scaffold. Opens the "Load Translator" window. Select one of the currently installed translators, and load the translator metadata and code into Scaffold.
  
Line 112: Line 112:
  
 ===== Scaffold Troubleshooting ===== ===== Scaffold Troubleshooting =====
-  * **Why does my translator work in Scaffold but not when I click on the toolbar icon in my browser?** 
-Scaffold runs the functions ''detectWeb'' and ''doWeb'' against the active document in the top browser window. Outside of Scaffold, clicking the toolbar icon runs the first web translator with a matching ''target'' regular expression that returns a non-false value from the function ''detectWeb'', when run on that document and URL. 
  
-This can differ from the active document in Firefox when the ''target'' expression or ''detectWeb'' conditions are too laxwhich can allow embedded documents, such as ''iframe''s used for advertising or sharing panes, to be detected as content pages. To see if this is what is happening, look at the debug output for save attempt from Firefox proper and check the URL that is being processed.+**Why does my translator work in Scaffold but not when I click the Save to Zotero button in my browser?** 
 +Scaffold runs the functions ''detectWeb'' and ''doWeb'' against the document in the Browser tab. In your browserclicking the toolbar button runs the first web translator with a matching ''target'' regular expression that returns non-false value from the ''detectWeb'' function when run on that document and URL.
  
-  * **Why won't my attachments save?** +These results can differ when the ''target'' expression or ''detectWeb'' conditions are too lax, which can allow embedded documents, such as ''iframe''s used for advertising or sharing panes, to be detected as content pages by the Zotero ConnectorTo see if this is what is happeninglook at the Zotero Connector's debug output for a save attempt in your browser and check the URL that is being processed.
-  * **Why do some fields show in the output pane but not in the created item?** +
-The output pane in Scaffold shows the item object as Zotero is about to save it-- it does not in fact save the objectAs 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 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.+**Why won't my attachments save?**
  
-Fields that are not allowed for the specified item type will be discarded, even if they show up in the output pane of Scaffold.+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. 
 + 
 +Fields that are not allowed for the specified item type will be added to the Extra field, even if they show up in the output pane of Scaffold.
  
 ====== Further Reading ====== ====== Further Reading ======
  
 More detailed instructions are available at [[https://www.mediawiki.org/wiki/Citoid/Creating_Zotero_translators|MediaWiki]]. These instructions may be slightly out of date. More detailed instructions are available at [[https://www.mediawiki.org/wiki/Citoid/Creating_Zotero_translators|MediaWiki]]. These instructions may be slightly out of date.
dev/translators/scaffold.1669280702.txt.gz · Last modified: 2022/11/24 04:05 by dstillman