Ability to track relative links between Inkdrop documents

Hi, wondering about the following feature or plugin:

Ability to track relative links between Inkdrop documents.

Given:

2 notes:

  • note “Parent”, and
  • note: “Child”
    which are linked (“Copy Note Link”) such that the Child link is pasted into the Parent note.

Then:

  1. There is no way of knowing in review mode that the link is internal, ie to another note in Inkdrop,
    or external, ie: to an outside link.

  2. There is no way for Child note to know that it’s being referenced by Parent note.

  3. Deleting Child leaves the link in the Parent to the now deleted Child,
    with no warning that Child has been deleted (and no warning before deleting Child).
    The Child link in the Parent note now points to nothing.

Therefore I propose the following features (or Plugin):

a) ability to know that a link is internal to Inkdrop

  • currently I do this manually by prepending “Ink:” to the child link,
    this could be done automatically.

b) ability to know which other documents have a link to this document.

  • ie: link-back
  • for example at the top of the Child note there could be a list of the Parent links which link to this document.

c) ability to be notified prior to deleted a linked note (Child) .
This could be a warning that this note is linked to by the following notes.

d) ability for a note to list the internal notes that it links to (forward links)

If this feature is not likely to be on the roadmap, and there is significant community interest, I’d be willing to make a plugin with this functionality (provided that’s doable in a plugin).

David

Hi Dav,

Thank you for the suggestions.
I guess you are talking about interconnecting notes, like Wiki and other apps that focus on connecting knowledge fragments. It’s important to keep in mind that there is a large gap in terms of the concept between them and Inkdrop.
Please check out my past discussion about it on this topic:

I mean, Inkdrop is, to be honest, not focused on strictly interconnecting notes.
It is basically a Markdown note-taking app. Markdown is a simple format to write roughly structured and mark-upped text. The concept of link in Markdown is from hyperlink that can be broken. So, strongly connected links/back-links are not supported.

That being said, you can implement it as a plugin.
The people in that topic would be happy if you made it!

a) ability to know that a link is internal to Inkdrop

Yes, it can be automated. The internal link URIs always start from inkdrop://note:.

b) ability to know which other documents have a link to this document.

You have to search with a URI with search API. And override rendering A tag.

c) ability to be notified prior to deleted a linked note (Child) .

Same as above.

d) ability for a note to list the internal notes that it links to (forward links)

Same as above.

I shared it on our Discord server so that it can get attention from other people.

Thanks, btw, I share iamben’s enthusiam for Inkdrop, I too love your product!
Re Roam and Obsidian, I haven’t looked at those in ages.
Re Plugin:

  • my thinking is that this could be implemented with one managed note which had a list of all “Child” notes and for each Child note a list of parents.
  • (Note I haven’t looked into what persistence hooks you provide for plugins, but at a minimum you have whatever you are using for the actual notes. Looks like PouchDB to me, but I could be wrong).
  • so, assuming using a managed note as the plugin persistence, then basically, at initial startup all notes would need to be parsed once, looking for Inkdrop notes to initialize the structure.
  • then whenever a note is edited, then the managed note is updated, ie:
    • a) remove all links to that note,
    • b) then for all Child links, create Child list if not exists, and add the Parent link.
  • this would presumably also have to happen on all synchronizations, and note timeline rollbacks.

Then, if ‘linkback’ plugin selected, for all open notes put a list of Parent links at the top of the note.

Probably that’s all that’s needed, but I’ll take a look at Roam and Obsidian at some point and also see what’s involved in creating a plugin.

Most likely the difficult part will be testing the rollback (history) and note sync scenarios, ie: in the case of sync conflicts, but I expect that’s solvable, at a minimum, by just recreating the index note.

David

I appreciate all your efforts. Those let me focus on improving the core experience.
Yes, it’s PouchDB:

You are right, you have to cache somehow the relationships of notes.
I guess you can store them as local documents; They will be stored only locally and never be synced.
You can watch note changes including sync & rollbacks via onNoteChange database API documented here.

Hope that helps!

Thanks, figured it was PouchDB!
I guess local documents could work, assuming re-indexing following a sync. If indexing is really fast (and it probably is), then we don’t even need to persist it, it can just stay in memory.

Next steps for me would be to:

  • take a look at your docs
  • then build a “hello world” plugin.
  • then run some profiling to see how long it takes to index notes, ie: if indexing is very fast, we don’t even need to persist at all.
    • I guess for a sample I’d have to create say 10,000 documents, with some percentage linked to some other percentage.
    • probably I should try that on mobile too, ie less resources.

Question:
Is there a way to develop this without affecting my own instance.
If I’m creating and throwing away 10,000 notes I don’t want that synced to my mobile and laptop instances!

I guess you can test the app inside a virtual machine with sync disabled.
Good luck!