zotero / scaffold

Zotero translator creation IDE
http://www.zotero.org/support/dev/scaffold
38 stars 9 forks source link

update for linter compliance and loop simplification #109

Closed retorquere closed 5 years ago

retorquere commented 5 years ago

Lines 69 - 73 of newWeb.jscould be replaced with ZU.processDocuments(Object.keys(items), scrape); I think, but I'm not sure whether the loop in the template is there to show that you could choose whether or not to include i in articles based on some condition.

retorquere commented 5 years ago

Can you recommend an URL I could use to test one of the template scrapers (or all of them)?

zuphilip commented 5 years ago

Lines 69 - 73 of newWeb.jscould be replaced with ZU.processDocuments(Object.keys(items), scrape); I think, but I'm not sure whether the loop in the template is there to show that you could choose whether or not to include i in articles based on some condition.

It would be fine to replace these lines as you suggested. No, there is no reason to show any choices here, because we should take all the elements, which the user has checked in the box for multiples.

zuphilip commented 5 years ago

Can you recommend an URL I could use to test one of the template scrapers (or all of them)?

You can try to use the basic template for rewriting one of these FW-based translator and see whether it works as it should.

retorquere commented 5 years ago

You can try to use the basic template for rewriting one of these FW-based translator and see whether it works as it should.

I'm not entirely sure how to bring this into action. I've only worked on import/export translators before, web translators are entirely new to me. I take it I take an existing translator and copy it's code into a freshly scaffolded one? Any suggestions for a simple one? Or should I take another approach?

zuphilip commented 5 years ago

I tested the new lines from doWeb and they work great. Thus, I will squash and merge that PR.

@retorquere As pointed out in another discussion, you could try to rewrite Vanity Fair.js or Verniana-Jules Verne Studies.js without the FW. But I would work within the same files (rename the functions before inserting a new web translator template).

zuphilip commented 5 years ago

Thank you!