Last active
November 4, 2024 20:26
-
-
Save nschneid/3134386 to your computer and use it in GitHub Desktop.
Zotero export translator that generates a zotero://select link to an item in the Zotero library. (First a simple version, as well as a version that displays minimal citation information and stores further details as title text.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"translatorID":"04623cf0-313c-11df-9aae-0800200c9a66", | |
"translatorType":2, | |
"label":"ZotSelect Link", | |
"creator":"Scott Campbell, Avram Lyon, Nathan Schneider", | |
"target":"html", | |
"minVersion":"2.0", | |
"maxVersion":"", | |
"priority":200, | |
"inRepository":false, | |
"displayOptions":{"exportCharset":"UTF-8"}, | |
"lastUpdated":"2010-07-19 03:03:00" | |
} | |
function doExport() { | |
var item; | |
while(item = Zotero.nextItem()) { | |
Zotero.write('<a href="zotero://select/items/'); | |
var library_id = item.libraryID ? item.libraryID : 0; | |
var titleS = (item.title) ? item.title.replace(/&/g,'&').replace(/"/g,'"') : "(no title)"; | |
var pubTitleS = (item.publicationTitle) ? item.publicationTitle.replace(/&/g,'&').replace(/"/g,'"') : ""; | |
if (!pubTitleS && item.type) | |
pubTitleS = '['+item.type+']'; | |
Zotero.write(library_id+'_'+item.key+'" title="'+titleS+' '+((item.conferenceName) ? item.conferenceName : pubTitleS)+'">'); | |
var creatorsS = item.creators[0].lastName; | |
if (item.creators.length>2) | |
creatorsS += " et al."; | |
else if (item.creators.length==2) | |
creatorsS += " & " + item.creators[1].lastName; | |
var date = Zotero.Utilities.strToDate(item.date); | |
var dateS = (date.year) ? date.year : item.date; | |
Zotero.write('(' + creatorsS + ' ' + dateS + ')</a><br/>'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"translatorID":"04623cf0-313c-11df-9aae-0800200c9a66", | |
"translatorType":2, | |
"label":"ZotSelect Link", | |
"creator":"Scott Campbell, Avram Lyon", | |
"target":"html", | |
"minVersion":"2.0", | |
"maxVersion":"", | |
"priority":200, | |
"inRepository":false, | |
"displayOptions":{"exportCharset":"UTF-8"}, | |
"lastUpdated":"2012-07-17 22:27:00" | |
} | |
function doExport() { | |
var item; | |
while(item = Zotero.nextItem()) { | |
Zotero.write("<a href='zotero://select/items/"); | |
var library_id = item.libraryID ? item.libraryID : 0; | |
Zotero.write(library_id+"_"+item.key+"'>"); | |
Zotero.write(item.creators[0].lastName+". "+item.date+". <i>"+item["title"]+"</i>"+"</a>"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment