Open zuphilip opened 6 years ago
Here is a list of the most common used functions from Zotero.Utilities and Zotero:
Thus, maybe we can concentrate on this and divide them into some groups, e.g.
text
, attr
ZU.xpath
, ZU.xpathText
ZU.doGet
, ZU.processDocuments
, ZU.doPost
ZU.cleanAuthor
, ZU.strToISO
, ZU.cleanISBN
, ZU.cleanDOI
, ZU.cleanISSN
ZU.trimInternal
, ZU.capitalizeTitle
, ZU.unescapeHTML
, ZU.superCleanString
, ZU.cleanTags
, ZU.removeDiacritics
Z.debug
Z.monitorDOMChanges
, Z.selectItems
, Z.loadTranslator
, ...Seems like we might be able to use autocomplete:
https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor
You can add enableLiveAutocompletion: true
to the live demo there to see it in action. (enableSnippets
is also an option, but not sure what that does.)
Good idea with the autocompletion. I played a little with the online example and tried to customize that as we could need. Here is what I have currently: http://plnkr.co/edit/Ep3bVPjjkm1laImq443t?p=preview . There are several options:
However, I could imagine to do additional some entry in the help menu to list the possible function with a short description. Let me know what you think about this.
Most of the functions are defined in https://github.com/zotero/zotero/blob/master/chrome/content/zotero/xpcom/utilities.js and listed at https://www.zotero.org/support/dev/translators/functions . Frequently I have to check these sources during writing Zotero translators when I want to use a special function but I forgot its name or the order of arguments which have to been passed. We can make another point in the help menu and output some static text, but maybe there are smarter ways to give here the translator developers any inline help. Any ideas?