Replies: 1 comment 3 replies
-
请提供debug output |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
这四种方式都不能导出为MD文件,更别说同步到OB里了哈哈哈
导出模板如下:
Export MD File Name (导出MD文件名):
${(noteItem.getNoteTitle ? noteItem.getNoteTitle().replace(/[/\\?%*:|"<> ]/g, "-") : "")}_${noteItem.key}.md
Export MD File Header (导出MD头):
${await new Promise(async (r) => { let header = {}; header.Title = noteItem.parentItem ? noteItem.parentItem.getField("title") : ""; header.Journal = noteItem.parentItem? noteItem.parentItem.getField("publicationTitle") : ""; header.author = noteItem.parentItem ? noteItem.parentItem.getCreators().map((au) => au.firstName + " " + au.lastName).join("; ") : ""; header.url = noteItem.parentItem? noteItem.parentItem.getField("url") : ""; header.DOI = noteItem.parentItem? noteItem.parentItem.getField("DOI") : ""; header.year = noteItem.parentItem.getField("date") ? new Date(noteItem.parentItem.getField("date")).getFullYear() : ''; header.$date_created = noteItem.parentItem.getdate_created = new Date().toISOString().split('T')[0]; header.$shortTitle = noteItem.parentItem? noteItem.parentItem.getField("shortTitle") : ""; header.tags = noteItem.parentItem.getTags().map((_t) => _t.tag); header.noteLink = Zotero.BetterNotes.api.convert.note2link(noteItem); header.$collections = ( await Zotero.Collections.getCollectionsContainingItems([ (noteItem.parentItem || noteItem).id, ]) ).map((c) => c.name); r(JSON.stringify(header)); })}
Export MD File Content (导出MD正文):
${mdContent.replaceAll("\\[\\[", "[[").replaceAll("\\#", "#").replaceAll("> \\[!", "> [!").replaceAll("\\](.*)", "](.*)")}
Beta Was this translation helpful? Give feedback.
All reactions