Last active
June 17, 2020 14:13
-
-
Save clement-moulin-frier/0502aff4e9117cca8f5f9200f0eb4b0f to your computer and use it in GitHub Desktop.
Zotero to Markdown link translator, adapted from https://gist.github.com/nschneid/3134386 // Place this file in the directory “translators” in your Zotero data folder. // Restart Zotero // Zotero Preferences -> Export -> Default Output Format -> ZotSelect Mardown Link // Now you can also use the shortcut for “Copy Selected Items – ctrl+alt+c on …
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":"03d26c56-aebb-4082-9615-f3ddb28d424c", | |
"translatorType":2, | |
"label":"ZotSelect Mardown Link", | |
"creator":"Clement Moulin-Frier", | |
"target":"markdown", | |
"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('['); | |
var library_id = item.libraryID ? item.libraryID : 0; | |
var titleS = (item.title) ? item.title : "(no title)"; | |
var pubTitleS = (item.publicationTitle) ? item.publicationTitle : ""; | |
if (!pubTitleS && item.type) | |
pubTitleS = '['+item.type+']'; | |
Zotero.write(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 + ')]('); | |
Zotero.write('zotero://select/items/'+library_id+'_'+item.key+')'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment