From 40b5da2c94f1cfbbc4dd1d52b1f157dc057fce5f Mon Sep 17 00:00:00 2001 From: me Date: Fri, 27 Jan 2023 16:18:51 -0500 Subject: [PATCH] added the option for the plugin to render the notes and annotations as a link that will open up the element in the browser --- src/App.vue | 10 +++++++++- src/settingsSchema.json | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index dd7ea22..f9896a4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -320,6 +320,8 @@ export default { return finds.length ? finds[0]["original-name"] : null; }, async loadPageNotes(page, uri, title, noteMap) { + const { itemsAsLinks } = + logseq.settings; if (!page || !uri) return; const pageProperties = { @@ -352,9 +354,15 @@ export default { for (const n of n_b) { const { hid, updated } = n.properties; - const content = n.content.trim(); + let content = n.content.trim(); const { parent, after } = n; const source = blockMap.get(parent ?? after); + + if (itemsAsLinks){ + //then we want the content to be wrapped in a link that references the annotation on the url that the item originiated from + content = `${content}`; + } + const block = await logseq.Editor.insertBlock( source?.uuid ?? page.name, content, diff --git a/src/settingsSchema.json b/src/settingsSchema.json index e975483..e164c4c 100644 --- a/src/settingsSchema.json +++ b/src/settingsSchema.json @@ -36,5 +36,11 @@ "key": "deletedFormat", "title": "Deleted Content Format", "type": "string" + }, + { + "default": false, + "key": "itemsAsLinks", + "title": "Make the notes, highlights and annotations links to the hypothes.is page", + "type": "boolean" } ]