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

attachment: link handling #61

Closed Mihara closed 9 months ago

Mihara commented 2 years ago

I suppose this is a feature request.

Currently, orgro does not appear to handle attachment: links properly, even though they're technically just a glorified species of file: links with a separately specified location.

Given an org file like

#+TITLE: Orgro attachment test

* This is a test :ATTACH:
:PROPERTIES:
:DIR:      orgro-test
:END:

This is a test of how orgro hangles attachments.

[[attachment:that-image.jpg]]

and an accompanying orgro-test/that-image.jpg I would expect the image to be rendered, yet it definitely isn't. In fact, clicking on it results in "No activity found to handle intent..."

amake commented 2 years ago

Thanks for the request.

This currently doesn't work because document content is not interpreted in any way.

To understand that the attachment: link should be resolved relative to orgro-test Orgro would need to actually understand the PROPERTIES drawer and handle the DIR property (with proper scoping and everything).

If the link were [[file:orgro-test/that-image.jpg]] then it should work.

Clicking on it passes the URL attachment:that-image.jpg to the OS for handling; unsurprisingly, it isn't handled and thus the error is reported.

amake commented 9 months ago

This will be supported in v1.35.2, which will be available for testing soon:

Note that resolving attachment: links depends on being able to resolve relative links; see the manual for details.

amake commented 9 months ago

v1.35.2 is available for testing on iOS and Android.

amake commented 9 months ago

v1.35.2 is now released on all platforms.