Skip to content

[Help] List notes with broken links #335

Closed Answered by kirasok
kirasok asked this question in Help
Discussion options

You must be logged in to vote

Thank you! I've changed allTitles: .notes|map(.title) to allTitles: .notes|map(.filenameStem) so it would work in cases when title and filename don't match

Solution to print missing notes:

zk graph --format json 2>/dev/null | jq '{ allLinks: .notes|map([.body|scan("\\[\\[(.*?)(\\|.*?)?]]")|.[0]])|add|unique, allTitles: .notes|map(.filenameStem) }| .allLinks - .allTitles'

and zk alias:

[alias]
broken = "zk graph --format json 2>/dev/null | jq '{ allLinks: .notes|map([.body|scan(\"\\\\[\\\\[(.*?)(\\\\|.*?)?]]\")|.[0]])|add|unique, allTitles: .notes|map(.filenameStem) }| .allLinks - .allTitles'"

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kirasok
Comment options

Answer selected by kirasok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants