Rename or Refactor breaks links
Idk if #898 is talking about this, but renaming and refactor breaks links
The problems are
- Renaming a note causes links which point to it in other notes to stop working
- Refactoring a note to a different notebook also causes links pointing to it to stop working
One possible solution is to automatically rename links in the background when a note is renamed. Zimwiki and tiddlywiki does this but in mindforger it will cause problems with #845. When I have two notes with the same name within the same notebook, auto renaming links will rename all links to notes with the same name.
Another idea would be to store a uuid in the metadata. Keepnote does this where keepnote links are of the format nbk:///70fcd8a6-948e-4fdb-8e3d-59cfee942966. The problem with uuids is, they obfuscate links, and it will be impossible to understand links looking at the markdown files outside of mindforger, like if I'm reading my markdown files on my phone.
I'd say a sensible middle ground would be to have links in format like [link text](#linkname)(:uuid) when links are added. This will also solve #845 as different notes with the same name will have different uuids.
This could be implemented in such a way that, mindforger will add a uuid to notes or links without it when they are accessed. That is, if a link like [link](#linkname) is clicked, mindforger will add a uuid to the link and make it like [link](#linkname)(:uuid) in the background. This has two advantages
- It will preserve backward compatibility, otherwise existing mindforger repositories without uuids will stop working with new versions
- Users will be able to add links to files they know the name to by just typing
[link](#linkname)without having to know the uuid, and mindforger will add the uuid when it's accessed next.
One problem of this approach is that, if mindforger files are opened in other markdown editors, it will show linkname(:uuid) in the preview because they have no concept of a uuid. Markdown has no compatibility for uuid.
@ramu-r thank you for raising this issue - it's very important problem and I ignored it for relatively long time. I also appreciate your ideas and suggestions! I would like to fix the problem along with links related subsystem: I want MindForger to find all broken links, make analytics related to links and also do the refactoring and/or renaming right.
I increased severity of this issue and planned it for the first milestone which will bring features. Please stay tuned!