Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:translators:framework [2011/11/27 00:44] – [Functions] adding explanation by erik from zotero-dev ajlyon | dev:translators:framework [2017/11/18 16:20] (current) – Add legacy notice adamsmith | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **While the Translator Framework still works, new translators using the Framework are no longer accepted, and we are migrating existing translators away from the format.** | ||
+ | |||
+ | **This page exists as legacy documentation only.** | ||
+ | |||
====== Translator Framework ====== | ====== Translator Framework ====== | ||
The translator framework is a way to build web translators that lets translator authors avoid most of the boilerplate that usually is required for new translators, | The translator framework is a way to build web translators that lets translator authors avoid most of the boilerplate that usually is required for new translators, | ||
- | The framework was written and contributed by Erik Hetzner and is licensed under the AGPLv3+. It currently resides at http://e6h.org/~egh/hg/ | + | The framework was written and contributed by Erik Hetzner and is licensed under the AGPLv3+. It currently resides at https://gitlab.com/ |
- | To use the framework, simply insert the framework code at the beginning of your translator, after the translator information block (JSON header). If you are using [[dev/ | + | To use the framework, simply insert the framework code at the beginning of your translator, after the translator information block (JSON header). If you are using [[dev/ |
You'll start writing beneath the line that reads: | You'll start writing beneath the line that reads: | ||
Line 54: | Line 58: | ||
=== FW.Scraper === | === FW.Scraper === | ||
- | * Required keys: '' | + | * Required keys: '' |
- | * Optional keys: '' | + | * Optional keys: '' |
=== FW.MultiScraper === | === FW.MultiScraper === | ||
Line 84: | Line 88: | ||
</ | </ | ||
Here the option is used to guarantee that the multiple item page has links to the BibTeX files that the translator uses. | Here the option is used to guarantee that the multiple item page has links to the BibTeX files that the translator uses. | ||
- | |||
- | == Delegation == | ||
- | It is possible to have a translator using this framework delegate processing to another translator, by setting the key '' | ||
- | |||
- | <code javascript> | ||
- | itemTrans : FW.DelegateTranslator({ translatorType : " | ||
- | translatorId | ||
- | </ | ||
- | |||
- | This delegation method can only be used with a '' | ||
=== Attachments === | === Attachments === | ||
Line 193: | Line 187: | ||
</ | </ | ||
==== FW.Scraper ==== | ==== FW.Scraper ==== | ||
- | For possible values of '' | + | For possible values of '' |
<code javascript> | <code javascript> | ||
FW.Scraper({ | FW.Scraper({ |