Implementing this feature will mostly solve the problem of notebooks nested in a hierarchy as discussed in https://github.com/orgzly/orgzly-android/issues/485.
I believe this feature is low cost and pays too much: by simply differentiating between file:/xxx and file:xxx you get:
Consistency between the links in your computer and the links in orgzly.
Consistency between the tree structure in your computer and the flattened structure in orgzly.
Ability to access arbitrary notebooks in the hierarchy.
It's true that this still requires to manually create index files to access the content buried in the hierarchy, but it still is a far cry from not being able to access this content at all!!!
I changed my mind regarding file:xxx. Despite the fact that currently "relative to repo" and "relative to file" mean the same thing, since orgzly just sees a list of files under the repo path, room should be made in advance for behavior more closely aligned with org mode, because hopefully one day file:proj1/notes.org would be accessible and then relative file links in proj1/notes.org would have to be accessed relative to proj1 as in org mode. So I propose this behavior:
file:/xxx relative to sdcardfile:xxx relative to notebook, which currently is equivalent to relative to repofile:/xxx relative to sdcard
There could be multiple "external" storages. For example the main emulated one, but also removable SD card at the same time. These all currently work (after 1a63a685bc987a3e7693ff216eac380ba60e689c):
file:file-on-main-storage.txt
file:/sdcard/file-on-main-storage.txt
file:/storage/emulated/0/file-on-main-storage.txt
file:/storage/0F18-3901/file-on-sd-card.txt
I think an option is needed to map / to whatever user wants it to be. Maybe the same with relative paths - some users might want file:xxx to be relative to SD card, not the repository (which might not even exist, or is remote).
Where would fit this syntax?
[[file-on-main-storage.txt]]
[[file-on-main-storage.txt]]
This is the same as file:file-on-main-storage.txt
It is necessary to allow to custom-map ~ (home directory) for compatibility with desktop Emacs, not only /
But I suggested it in the another issue
I have recordings in an apps directory on my phone. I share those with my computer with syncthing. If I could custom map ~ I would be able to map it to something like /directory/i/have/perms-to-symlink and then emulate my computer hierarchy there like:
+ /directory/i/have/perms-to-symlink
- voice-recordings -> /path/to-android-apps/recording-file-directory
- pictures -> /DCIM/path-to-camera-pictures
So, does anyone know how to write file links for using with both Emacs and Orgzly?
Hi, was this solved? I am trying to see the same images, in the same notes (path and images duplicated) in emacs and orgzly and I can't. It seems this could be called almost a bug.
@Ypot it is still not
workaround for notes dir: when creating note, type 2 different links, 1 for Emacs, 1 for Orgzly
for example:
[[sync-dir/picture.jpg]]
[[./picture.jpg]]
Orgzly shows you the first link image (located in /sdcard/sync-dir) while the Emacs uses relative path and shows you the second link image (located just here). Not pretty enough, but works with Syncthing
@vit1-irk could it be definitively solved using org-attach feature?
https://github.com/orgzly/orgzly-android/issues/1
@vit1-irk could it be definitively solved using org-attach feature?
1
@Ypot IDK, but it needs some hacks both for Orgzly and for Emacs to work properly
See this: https://emacs.stackexchange.com/questions/18404/can-i-display-org-mode-attachments-as-inline-images-in-my-document
I think this works, at least for files
file:/sync-dir/picture.txt - looks in /
file:picture.txt - looks in current directory
The things that doesn't work for me is links to heading inside the file, like file:my-notebook.org::*Heading1
From SO answer, got this link to manual on attachments.
Can we replicate this functionality?
The things that doesn't work for me is links to heading inside the file, like file:my-notebook.org::*Heading1
I would love to see this work like it does on desktop.
One possible workaround: Use a path that works in Orgzly: file:./Orgzly-Syncdir/Images/foo.jpg, that is, the path is relative to the sdcard. Here, Orgzly-Syncdir is the directory that contains the notebooks and is synced (e.g., with syncthing). Then, inside the synced directory Orgzly-Syncdir, add a symbolic link ln -s . Orgzly-Syncdir. Now, your desktop Emacs sees a relative path ./Orgzly-Syncdir/Images/foo.jpg too. But still it would be nice to see a proper solution.
Most helpful comment
I changed my mind regarding
file:xxx. Despite the fact that currently "relative to repo" and "relative to file" mean the same thing, since orgzly just sees a list of files under the repo path, room should be made in advance for behavior more closely aligned with org mode, because hopefully one dayfile:proj1/notes.orgwould be accessible and then relative file links inproj1/notes.orgwould have to be accessed relative toproj1as in org mode. So I propose this behavior:file:/xxxrelative to sdcardfile:xxxrelative to notebook, which currently is equivalent to relative to repo