|
From: | Max Nikulin |
Subject: | Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9.5.2/)]) |
Date: | Mon, 31 Oct 2022 21:37:19 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
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"
[Prev in Thread] | Current Thread | [Next in Thread] |