I typically create multiple [[xyz]]s as I go, so I have a glossary of sorts. Later I want to fill-in exactly what an xyz is, but there are hundreds of these things so I have two questions:
how do I find all of the uncreated mentions - e.g. how would I know xyz is even a thing
how do I know if I have already created one or if I need to create a new one
For the first question, I can’t simply load the original page in which I first entered xyz and then look at the “Unlinked mentions” because I can’t recall in which page I referenced xyz (there are literally hundreds of these things ;-))
Pages not linked to any other page show up on the periphery of the graph. I use that to locate pages that I have not linked yet. But I agree, this could be improved.
@raivivek, I think he’s describing the situation in which he’s linked to a page that doesn’t exist. The graph shows existing pages that aren’t linked.
@yatesco, I haven’t seen this functionality in Obsidian yet. For now I’d probably create an external script to find all unique instances of [[thing]] for which there is no thing.md file.
I’m not sure I understand fully. But perhaps find one instance (with cmd+f or search) to create the initial link and then follow unlinked mentions, repeat for each thing?
Alternatively reading your post reminded me a bit of this use case I was having troubles with so perhaps it’s similar to what you’re experiencing?
Ah, so a list of blank links. Yes I would like that. Perhaps that could be a page in Obsidian that you could browse. Checking off which you’d like to have files be created (or create file for all blanks)
I typically create multiple [[xyz]] s as I go, so I have a glossary of sorts. Later I want to fill-in exactly what an xyz is
I do the same!
I just use {{note I want to create}} and then occasionally search through my vault for {{ to find them, since I’m not using two curly brackets for any other purpose.
But yeah, I do believe that there should be some obvious way to check for broken [[links]] from within the interface.
So I just did a cleanup using VS Code. It’s not the easiest way, but it works. Hope it helps (It goes without saying: first try on a copy of your fault)
Empty .trash
Write all filenames to a text file. In terminal: find . -type f -name '*.md' > files.txt
Find → .md replace with nothing (to remove extension)
Now you have a list of only titles
Find all links in vault. In VS Code:
Install ‘Sort lines’ plugin
Open vault-folder
Find all (with regex) → \[\[(.*?)\]\]
Open search results in editor
Copy search results in editor to new file
Perform same search in new file
shift+cmd+p → Select all occurences of find match
Copy + paste
shift+cmd+p → Sort lines (unique, etc...)
Find and replace [[ and ]] with nothing
Save as links.txt
Now you have two files. One with all the links and one with all the files. We want to find all the dead links. That means the lines from links.txt that do not occur in files.txt. In VS Code:
In files.txt
Place a cursor at the start of each line by holding option+cmd+↓ until the end of the file
Type (\n
Move to the end of the line
Type )|
Press delete so that all lines become 1 line
Remove the pipe at the end
The line should now look like this: (\ntitle one)|(\ntitle two)|(\ntitle three)
Copy the line
In links.txt
Find (with regex) and paste the line
shift+cmd+p → Select all occurences of find match
Now all the links that are also files are selected
Press delete
Now all the lines that are left are dead links
Save the file as deadlinks.txt
Ok so now we have all the dead links, so we want to remove all the square brackets for those = replace all the [[Title with dead links]] with Title with dead links. Still in VS Code, in deadlinks.txt:
Find (with regex) \n and replace with \| (pipe)
Surround the resulting line with \[\[( and )\]\] so that it looks like this: \[\[(title one|title two|title three)\]\]
Find all (with regex) and paste the line from deadlinks.txt. Now you should see all the dead links form your vault in your search results
I also like to create wiki-links as I go, and don’t want to interrupt my writing by following those rabbit trails right away. I just discovered that by enabling the Preview Mode plugin, I can do a quick sweep of the wiki-links in a note (ctrl + mouseover) when I’m done. If it’s an orphan link, I’ll see an “xyz has not been created yet. Click to create.”
I may click to create but not have time then and there to flesh it out. To prevent blank and incomplete notes from cluttering up my zettelkasten, I’ve changed the File settings so that new notes appear in a folder labeled “Inbox.” Having them clearly marked makes it easier to come back to and clean up or delete them. Once the notes are complete enough that they’ll make sense to me a month from now, they graduate to my Permanent Notes folder.
If I were you, I’d use preview mode to hunt down your orphansfind good homes for the orphans a few at a time, rather than a bulk script. Filling in your glossary will be more beneficial when you see the word in context, and will be less demoralizing seeing 100 blank notes appear in your inbox!
As an aside, maybe orphan isn’t the right term. These notes have parents, but they haven’t been born yet. Embryonic notes… Seeds of an idea…
I use “[[entity links]]” frequently as well – often for proper names (people, books, etc). It looks like the graph shows these uncreated link-entities with connections to their backlinks. Clicking on the uncreated link-entity’s node will generate the actual note in the folder you designate for new notes (mine is “Inbox”).
If these uncreated link-entity nodes could be visually distinguished – say, by a color – from note-nodes, it would be easy to go in and create the actual notes if you needed to.
Replying to myself and others! Looks like version 0.94 incorporates this suggestion:
Blockquote In preview mode, internal links to notes that don’t exist yet are now given the CSS class is-unresolved, and now shows up in a different color than links to existing notes.
Yeah, I was wrong about that. The release notes refer to visualizing a non-existent internal note in preview, not in the graph.
But there is a css class for nonexistent files in the graph. So you should be able to see these depending on your theme, I suppose. See the attached screenshot:
You could conceivably use a CSS snippet to provide greater contrast for the nonexistent nodes.
You also might be able to use a graph filter to show ONLY your nonexistent notes. There’s already a toggle to hide nonexistent notes.
I am trying to figure out how to do that. For example, I have many people notes with [[@name]] that are non-existing files. I also have many non-existing [[random concept]] files. I was hoping that I could filter out the people notes by -file:@ but that kind of filter doesn’t work for non-existing files as it seems.
So is there a way to filter the graph based on the note titles of non-existing files? Or is there at least a way to see non-existing files only?
Well, I have been messing around for an hour and I can’t find a way to use the Obsidian query to show ONLY nonexistent notes. I have come across feature requests to achieve that result, so who knows… maybe some day.
But as I said above, you can use CSS to visually distinguish nonexistent notes. I use the snippet pasted in below:
/* to style the new nodes in the 0.9.1+ */
.theme-light .graph-view.color-arrow {
color: #5cc863;
}
.theme-light .graph-view.color-fill-tag {
color: #440154;
}
.theme-light .graph-view.color-fill-attachment {
color: #277f8e;
}
.theme-light .graph-view.color-fill-unresolved {
color: #fde725;
}
There is a plugin called “Find unlinked files and unresolved links” that’s helps a lot. It generate a page with all the “unlinked files” and another, if you want, with “unresolved links”. All the results are internal hyperlinks that brings you straight to the given file.