Zettelkasten Forum

[FEATURE DISCUSSION] Linking to notes using UIDs inside the notes

In this thread, a slightly off-topic discussion had emerged about the usefulness of UIDs for robust linking between notes, and about the downsides of starting note names with UIDs. @ctietze then asked us to move our ideas and suggestions to separate threads.

I had suggested a possible change to The Archive that would allow for the UIDs to be moved from the beginning of the file name to the content of a note:

Ideally, we would want the UID to not clog up the file name, but still be able to use it to link to a note directly and not just get a list of notes, which also includes all the notes that link to the original note. One way to accomplish this would be to include the UID together with a prefix in the note body, for example "ID:201802130850". The format of the internal links would remain "[[201802130850]]".

The obvious downside of this approach would be that, with the current version of The Archive, you would need to manually prepend "ID:" to the search string after clicking a link (and also hit Arrow Down to actually view the single remaining note). That would not be terribly convenient... unless The Archive had an option "[x] Prepend ____ whenever an internal link is clicked". Ideally, TA would also always show a note if it was the only remaining search result -- this would actually be a universally useful feature, especially when you use tags.

Maybe there are other ways to solve this problem, but implementing such a prepend option does not strike me as terribly difficult, and it would allow you to keep foolproof linking without all the disadvantages of starting file names with UIDs.

Fortunately, moving UIDs between file names and note bodies is very easy to do programmatically, so even if you already have a Zettelkasten with 3000 notes whose names start with UIDs, you could just use a short script to migrate them to the new format. The same holds true if you, for whatever reason, wanted to go back to file names starting with UIDs: All you would need to do is to run a simple script once.

I intentionally put "[FEATURE DISCUSSION]" instead of "[FEATURE REQUEST]" in the title of this topic, because (A) it is possible that there is an even more elegant solution to the problem that didn't occur to me, and (B) because I am not 100% sure whether I myself would actually switch to linking via UIDs, because I don't rename notes very often, my note titles are not too long, and I kinda like the links (and especially the external thearchive:// links to be self documenting).

I am, however, curious to hear what others think about this approach and the idea to have a "[x] Prepend ____ whenever an internal link is clicked" function in The Archive.

PS: For the other feature mentioned in the quoted post, that a note is shown automatically when it is the only search result left, I have created a feature request thread here.

If you like The Archive's "PrettyFunctional (Basic)" theme, consider upgrading to the "PrettyFunctional (Regular)" theme.


  • The Quiver, Ulysses, Bear, etc use UID numbers in their database that the user never sees. Since TA is not a database driven model, UID numbers really don't make much sense. I prefix my files with their main subject and use that to sort of hint what the note file is for. UID numbers would make that messy, especially since I use other Alfred scripts to work with the files as well. Therefore, I vote for not having a UID number for each file.

  • @Basil said:

    I am, however, curious to hear what others think about this approach and the idea to have a "[x] Prepend ____ whenever an internal link is clicked" function in The Archive.

    I very much like the idea of not having to put UIDs and the first thing in a file's name to get functional links in The Archive.

    I don't know that automatically prepending a string is the right solution. For me the current behavior of The Archive when using UIDs as filename prefixes is perfect for me: you jump to the note you're interested in, but all the notes that link to that note also show up in the list of search results. Prepending would mean that the linked note would usually be the only search result.

    What if The Archive offered a preference for what constitutes a link match? Currently the only thing that constitutes a link match is that the name of the file uniquely corresponds to the contents of the link. Other options could serve just as well: e.g., the link text appears uniquely in a note with the string "ID: " prepended to it, or what have you.

Sign In or Register to comment.