Created
May 24, 2022 14:23
-
-
Save eleanorkonik/a89bf1c133b43cf671c3495dc3ad3b9d to your computer and use it in GitHub Desktop.
Find non-existent notes with multiple files linking to them... and readwise imports with lots of useful annotations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```dataview | |
TABLE file.inlinks AS Inlinks, file.outlinks AS Outlinks, file.tags AS Tags | |
FROM "10 Pending" | |
WHERE length(file.inlinks) > 0 OR length(file.outlinks) > 1 Or length(file.tags) > 2 | |
SORT file.size ASC | |
``` | |
```dataviewjs | |
const count = 2; | |
let d = {}; | |
function process(k, v) { | |
Object.keys(v).forEach(function (x) { | |
x = dv.fileLink(x); | |
if (d[x]==undefined) { d[x] = []; } | |
d[x].push(dv.fileLink(k)); | |
}); | |
} | |
Object.entries(dv.app.metadataCache.unresolvedLinks) | |
.filter(([k,v])=>Object.keys(v).length) | |
.forEach(([k,v]) => process(k, v)); | |
dv.table(["Non existing notes", "Linked from"], | |
Object.entries(d) | |
.filter(([k, v]) => v.length >= count) | |
.sort((a, b) => b[1].length - a[1].length) | |
.map(([k,v])=> [k, v.join(" • ")])) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assigned to me