From b0c9881768441998973c9d8bd89a59509dc24f79 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 13 Nov 2023 18:09:46 +0100 Subject: [PATCH] added: command to list backlinks --- main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.js b/main.js index eb79ddf..ec12dff 100644 --- a/main.js +++ b/main.js @@ -275,6 +275,10 @@ var commands = [ hint: "Sort text", action: sortselection, allowunsaved: true +}, +{ + hint: "Show backlinks", + action: backlinks }]; var snippets = [ @@ -1564,6 +1568,14 @@ function getlinesrange() }; } +function backlinks() +{ + searchinlist(localdata + .filter(n => n.content.includes("[[" + currentnote.title + "]]")) + .map(n => n.title)) + .then(loadnote); +} + function sortselection() { var content = md.value;