Add wikilinks support

I have a set of notes that I’ve collected over the years of using like a thousand different note taking apps :wink:

Right now I need to merge two sets of notes, which comes with a great challenge of moving notes around. In SB I know I can do a simple change within a single note and it will propagate to other notes that link to that note.

Problem is - I have A LOT of notes and it’s not really practical to do it this way. Right now I don’t really know how to achieve this within SB and TBH I’m procrastinating the merge precisely because of this.

I’ve came to a conclusion that the problem really originates from the way notes are linked.

In Obsidian when you have a file in path path/to/file.md and you want to link it in another note you simply write a wikilink like: [[file]] - without having to put in the full path. This makes moving notes around very trivial because resolving the right path is done in runtime.

I’m aware that this automatically creates a problem of how to deal with duplicates, but I can imagine at least a few simple ways to deal with it.

I feel like this addition would make SB more versatile and easier to work with in larger note-bases. One could, for example, move notes around in file explorer instead of inside SB. What do you guys think?

And obviously what do you @zef think about this? :slight_smile:

3 Likes

I’m also in the same situation and for this I haven’t switched 100% to silverbullet, but only 80% :grinning_face:.

Moving notes around is not seamless. I organize notes by directories like project, archive, etc.

Thouhts,

  1. Native support: Existing majority can’t be forced to switch, so you need to make it configurable. Resolving duplicates - show picker and let user resolve :grimacing:. Default auto complete behaviour - needs to change to return basename.

  2. Extension (Override) Option: Give a hook to user to override default wikilink resolution. User writes space lua to find the appropriate page and navigate. Auto complete would still resolve to full path tho. Wait, let’s add another hook :wink: and override that too.

I cannot comment on the feasibility. Just thoughts for discussion.

Previous discussions,

I haven’t seen the previous discussions on the topic. I can see that Zef did mention duplicates.
I think that it would be perfectly acceptable for the duplicates to be solved at runtime. A bit like Wikipedia does serving the disambiguation page.

After all - user can choose to place the hard link by himself at any time and having this disambiguation page could even help users to create new connections (when using SB as second brain).

And I really feel that the rigidity of current page linking makes it hard to manage notes, and this is pretty much the base purpose of such software :wink:

1 Like

Sorry I can’t just write it right now, but I would use some SilverBullet API and traverse the files for links and fix them this way. I used to do this kind of stuff before V2, I’m not sure what the tools are now.

However:

If the links could work with subpaths in general, you could trivially share content between a private space and a public subset served from a folder by another instance - public but read only.

Overdone UX for compromise:

Now we have blue links - exists, red - missing, maybe we could add yellow for inexact match. After clicking such link we could have a dialog:

Link [[bar]] on page “foo/abc” resolved to “foo/bar”, would you like to update the link to fix Mentions?
OK | Cancel | Don’t ask again

We can revisit this again, maybe there’s a path.

What is maybe doable is indeed to allow for the obsidian style links and resolve them on the fly. If you create a link to a page [[page]] and there’s no such page at the root, but there’s one nested somewhere, it could still appear as a valid link and navigate to that nested one. Would that suffice?

The question then becomes, what about page completion, should new page links use the “full path” or the short ones? I suppose you’d want to make this configurable.

I suppose renaming will become more complicated, and indeed there would have to be a solution to the ambiguity problem, what if there’s two pages with the same name nested in different places.

1 Like

What does obsidian do about the edge cases/ambiguity :eyes:

What may also be interesting is firing an event if the link can’t be found or parsed correctly. Similar to the pageCreating event. Then the edge case logic, custom logic could all be handled by the user code.

1 Like

You can probably already implement this now indeed by listening to page:created, look up an actually existing page and navigating there. Not pretty but may work. Then restyle broken links to look like regular ones and bob’s your uncle! :rofl:

2 Likes

As to what Obsidian does: I think it switches to absolute links when there is ambiguity (also retroactively for old links). I never liked this solution, but it optimizes for short links most of the time.

For my use case - definately. I’d just like to drop the path from the links. I don’t really have different notes with the same name, but I get that people take notes in various ways.

I’d probably leave this as a toggle option in the configuration - it might really depend on how people take notes.

True, I don’t think you can escape this complexity. I guess the Obsidian’s solution to “materialize” the links when there is a duplicate is a quite sane option. Right now we have ALL the links are hard links.