amake / orgro

An Org Mode app for iOS and Android
https://orgro.org
GNU General Public License v3.0
478 stars 22 forks source link

Resolve id: links to other files #47

Closed amake closed 1 week ago

amake commented 3 years ago

Partially for #17; as discussed in #44.

id: link IDs are UUIDs and do not specify filenames, so in order to resolve such links to sections in other files, we will need to somehow identify which file contains the ID.

We can get away with not doing a full org_parser parse of every potential target file by doing something much simpler:

stream file content linewise and just extract the IDs e.g. with /:ID:\s+[0-9A-Z-]+/. On iOS in particular this could mean forcing downloads of files that aren't available locally, but if the majority use case for Org Roam is lots of small files then it could be OK.

This would probably happen in the native layer, with the resulting file identifier being returned to the Dart layer.

As a first attempt I may do this on-demand (no indexing mechanism) and see how it goes. If it's unbearably slow to resolve a link (quite possible for e.g. large Org Roam databases like https://github.com/jethrokuan/braindump/tree/master/org) then an indexing mechanism will be needed.

The index complicates things significantly:

amake commented 3 years ago

Progress is slow on this so far due to other projects and life stuff.

At the moment I have implemented on iOS searching through files to find a particular ID. Some hurdles:

amake commented 3 weeks ago

A relatively simple implementation seems to perform OK. This will be available for testing in v1.40.0 soon:

amake commented 1 week ago

v1.40.4 is now available on all platforms.