On 31/10/2022 13:13, Ihor Radchenko wrote:

You are right. file.odt is a virtual folder representing ZIP container,
so relative links to external files should be prefixed with "../".

Thanks for checking!
See the attached tentative patch.

-                (org-export-file-uri raw-path))
+                 (pcase (org-export-file-uri raw-path)

[[file:~/examples/org/odt-id/file-b.org]] link is exported as ./file:///home/user/examples/org/odt-id/file-b.org

+                   (`(and (pred #'file-name-absolute-p) ,path)
+                    path)
+                   (path
+                    ;; OpenOffice treats base directory inside the odt
+                    ;; archive.  The directory containing the odt file
+                    ;; is "../".
+                    (concat "../" path))))

A couple of other notes.

In HTML <a href="#">top</a> or #top works as a link to the beginning of the document. I am curious if ODF has a similar feature. I mean ID at the top of the same file that generates file.org link instead of internal one for both HTML and ODF formats.

It seems org-id.el should be extended to handle some features common to all formats such as custom suffix instead of ".org"



Reply via email to