Fsnotes: Filter to find unlinked (orphaned) notes?

Created on 4 Aug 2018  路  4Comments  路  Source: glushchenko/fsnotes

Hi Newbie here,

Supporter of both Mac and iOS app due to active development. Kudos and keep up the great work.

I am a big fan of the Zettelkasten method which includes highly hyperlinked notes to other notes. Question: is there any way, filter to find notes that are NOT linked to other notes? In other words, orphan notes?

Thanks in advance,
Tom

Most helpful comment

Ah yes, misunderstanding from me.

In that case I would approach it from the shell:

  1. grep '](' * | cut -d'/' -f 4 | sed -E -e 's/\)/.md/g' -e 's/%20/ /g' | sort > linked.txt

    • grep (list) all notes containing Markdown links

    • cut (extract) the linked filename

    • correct format of filename (add .md ending, decode spaces)

  2. ls -R1 *.md | sort > all.txt
  3. list all notes
  4. recursive subfolder search
  5. one per line
  6. sorted
  7. diff linked.txt all.txt
  8. show files from all.txt that are not in linked.txt

馃馃槑

All 4 comments

It can be done easily for tags, because FSN uses the standard MacOS tags so you can use Finder to do a complex logical search on them.

For hyperlinks, you should be able to do a "search all" in a good text editor (Sublime?) on your notes folder so that you can see which files don't contain ]( - part of a markdown hyperlink.

Let us know how you get on.

I'd not heard of Zettelkasten, very cool, thanks!

Your "search all" suggestion will only find notes that don't link out to others. I think the original issue is how to find notes that no other note links to, and I can't think of any way to achieve that without specifically writing code to do so.

The logic would go something like this, I guess;

  1. go through every note and record every link found
  2. go through every note and see if a link to it is found in the aggregate collection made in step 1
  3. show any notes which do not have a link

Whilst I'm dubious that this is within scope for FSNotes, unfortunately I can't think how you could achieve it any other way :( @gingerbeardman any other ideas? :)

Ah yes, misunderstanding from me.

In that case I would approach it from the shell:

  1. grep '](' * | cut -d'/' -f 4 | sed -E -e 's/\)/.md/g' -e 's/%20/ /g' | sort > linked.txt

    • grep (list) all notes containing Markdown links

    • cut (extract) the linked filename

    • correct format of filename (add .md ending, decode spaces)

  2. ls -R1 *.md | sort > all.txt
  3. list all notes
  4. recursive subfolder search
  5. one per line
  6. sorted
  7. diff linked.txt all.txt
  8. show files from all.txt that are not in linked.txt

馃馃槑

馃槷

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erikrose picture erikrose  路  4Comments

jakemkc picture jakemkc  路  4Comments

jakemkc picture jakemkc  路  3Comments

lowski picture lowski  路  3Comments

tewe picture tewe  路  3Comments