org-reveal icon indicating copy to clipboard operation
org-reveal copied to clipboard

Image path after export

Open jacquesdurden opened this issue 2 years ago • 2 comments

I'm used to define a specific folder for any export of an org-mode file. I set up this by following the procedure describe here. In particular, this amounts to this setting in my case

(defvar org-export-output-directory-prefix "export_" "prefix of directory used for org-mode export")
(defadvice org-export-output-file-name (before org-add-export-dir activate)
  "Modifies org-export to place exported files in a different directory"
  (when (not pub-dir)
    (setq pub-dir (concat org-export-output-directory-prefix (substring extension 1)))
    (when (not (file-directory-p pub-dir))
      (make-directory pub-dir))))

However, this configuration does not seem compatible with the way ox-reveal exports image path. So if an image "dummy.jpg" in a org-mode file is placed in the folder "tmp/" (or even "./"), the html produced by ox-reveal and placed in "export_html/" with the code above does not follow the path of this image. It points to "tmp/dummy.jpg" instead of "../tmp/dummy.jpg".

Do you know a way to solve this problem? Is it possible to tell ox-reveal where to find all images?

Thank you.

jacquesdurden avatar Oct 18 '22 11:10 jacquesdurden

ox-reveal has no way to know the target file name or path. It is derived from org mode HTML backed, which exports image URL as written in org file.

For the specific "../tmp/dummy.jpg" case, I would like to suggest either

  1. Use an absolute path rather than a relative one. Or
  2. Place org files in a directory with the same level of tmp/ and export/, so that both org file and the exported HTML can find the image by "../tmp/dummy.jpg"

yjwen avatar Nov 27 '22 08:11 yjwen

Thanks. Would it be possible to tell org-reveal  by setting a variable? Le 27 nov. 2022, 09:09 +0100, Yujie Wen @.***>, a écrit :

ox-reveal has no way to know the target file name or path. It is derived from org mode HTML backed, which exports image URL as written in org file. For the specific "../tmp/dummy.jpg" case, I would like to suggest either

  1. Use an absolute path rather than a relative one. Or
  2. Place org files in a directory with the same level of tmp/ and export/, so that both org file and the exported HTML can find the image by "../tmp/dummy.jpg"

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

jacquesdurden avatar Nov 27 '22 09:11 jacquesdurden