added: command to list backlinks

This commit is contained in:
quenousimporte 2023-11-13 18:09:46 +01:00
parent 62b28afedd
commit b0c9881768
1 changed files with 12 additions and 0 deletions

12
main.js
View File

@ -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;