-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Should have any problems now with undefined or invalid fields.
- Loading branch information
Showing
1 changed file
with
27 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
{ | ||
"translatorID":"8dbf9b92-f796-4153-8f2e-ac6c157500dc", | ||
"translatorType":2, | ||
"label":"Markdown Item URI", | ||
"creator":"Silent", | ||
"target":"markdown", | ||
"minVersion":"2.0", | ||
"maxVersion":"", | ||
"priority":200, | ||
"inRepository":false, | ||
"lastUpdated":"2020-10-13" | ||
} | ||
|
||
|
||
function doExport() { | ||
var item; | ||
while(item = Zotero.nextItem()) { | ||
|
||
Zotero.write("["+item.creators[0].lastName+". "+item.date+". *"+ item["title"] + "*]") | ||
Zotero.write("(zotero://select/items/"); | ||
var library_id = item.libraryID ? item.libraryID : 0; | ||
Zotero.write(library_id+"_"+item.key+")"); | ||
"translatorID":"8dbf9b92-f796-4153-8f2e-ac6c157500dc", | ||
"translatorType":2, | ||
"label":"Markdown Item URI", | ||
"creator":"Silent", | ||
"target":"markdown", | ||
"minVersion":"2.0", | ||
"maxVersion":"", | ||
"priority":200, | ||
"inRepository":false, | ||
"lastUpdated":"2020-10-15" | ||
} | ||
} | ||
|
||
|
||
function doExport() { | ||
var item; | ||
while(item = Zotero.nextItem()) { | ||
var date = new Date(item.date).getFullYear() | ||
|
||
var year = date && !isNaN(date) ? date + ". " : (typeof item.date == 'undefined'? "" : item.date + ". "); | ||
var library_id = item.libraryID ? item.libraryID : ""; | ||
var author_lastname = item.creators[0].lastName ? item.creators[0].lastName + ". " : ""; | ||
var title = item.title ? "*" + item.title + "*" : ""; | ||
var key = item.key; | ||
|
||
Zotero.write(`[${author_lastname}${year}${title}](zotero://select/items/${library_id}_${key})`) | ||
} | ||
} | ||
|