Skip to content

Instantly share code, notes, and snippets.

@htlin222
Last active June 18, 2024 08:37
Show Gist options
  • Save htlin222/f40be1216055976d870fd9cf6b3376ba to your computer and use it in GitHub Desktop.
Save htlin222/f40be1216055976d870fd9cf6b3376ba to your computer and use it in GitHub Desktop.
{
"translatorID": "d90fd4af-9eeb-4232-9feb-8fd05bcf6f8b",
"translatorType": 2,
"label": "Markdown Item URI with Citekey",
"creator": "Silent",
"target": "markdown",
"minVersion": "2.0",
"maxVersion": "",
"priority": 200,
"inRepository": false,
"lastUpdated": "2020-11-30"
}
function doExport() {
var item;
while (item = Zotero.nextItem()) {
var date = Zotero.Utilities.strToDate(item.date).year;
var year = date && !isNaN(date) ? date + "" : (typeof item.date == 'undefined' ? "" : item.date + "");
// var library_id = item.libraryID ? item.libraryID : "";
var author_lastname = getValidAuthor(item);
var title = item.title ? "**" + item.title + "**" : "";
// var key = item.key;
// var citekey = item.citationKey ? `[[${item.citationKey}]]` : "";
Zotero.write(`
> [!NOTE]
> 🚩**${item.title}**
> ${item.journalAbbreviation} ${year};${item.volume}(${item.issue}):${item.pages}
> TL;DR: [[LitNote/${item.citationKey}.md|${author_lastname}(${year})]]
> local: [📚](zotero://select/items/@${item.citationKey})
> URL: [🌐](${item.url})
> DOI: [📘](https://doi.org/${item.DOI})
> citekey🔑: [@${item.citationKey}]
`);
}
}
function getValidAuthor(item) {
if (item.creators && item.creators[0] && item.creators[0].lastName) {
return item.creators[0].lastName + ". ";
} else {
return "";
}
}
@htlin222
Copy link
Author

It will took like:

===

Note

Azacitidine and venetoclax in previously untreated acute myeloid leukemia
TLDR: [[LitNote/dAzacitidineVenetoclaxPreviously2020.md|D. (2020)]]
Zotero 📚: Item
CiteKey🔑: [@dAzacitidineVenetoclaxPreviously2020]

===

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment