emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Pablo Palazon <pablo.palazon@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problems with attachment links in exported files
Date: Sun, 03 Jan 2021 20:46:50 GMT	[thread overview]
Message-ID: <87a6tpd9zb.fsf@kyleam.com> (raw)
In-Reply-To: <CAOKwhjuHieLP-2=Wbx50gYJLJHQFJ4bhbuYcQaA7o_ZWEMXPuw@mail.gmail.com>

Pablo Palazon writes:

> Hi everyone!
>
> I've had a trouble with attachment type link on exporting. I configured
> org-attach directory and using org-id and it works great on emacs, all
> those links work great. I can see any attach linked on org notes, but in
> exported files all those links point to local directory instead of the
> right attached folder.
>
[...]
> I tried to use
>
> (add-hook 'org-export-before-parsing-hook 'org-attach-expand-links)
>
> And it works except for inline images, but I don't understand why is not on
> org-mode repository code.

Hmm, I'm not sure what you mean by the last part.  The snippet you show
is in the Org repo, specifically in org-attach.el:

  https://code.orgmode.org/bzg/org-mode/src/release_9.4.4/lisp/org-attach.el#L750

I'm not an org-attach user, so I might be missing something obvious, but
I wasn't able to trigger the issue with inline links.  Here's what I
tried using the default configuration on the master branch (c3888a8b7):

  (require 'org-attach)
  (let ((default-directory (make-temp-file "org-attach-export-test-" t)))
    (with-current-buffer (find-file-noselect "scratch.org")
      (insert "* h1\n\n")
      (org-attach-url
       "https://orgmode.org/worg/images/agenda/org-agenda-colorized-blocks.png")
      (insert "attachment:org-agenda-colorized-blocks.png")
      (org-open-file (org-html-export-to-html))))

That output includes

    <img
    src="file:///tmp/org-attach-export-test-Surcu0/data/ad/4bdf8f-a28e-4621-a1e4-dc772ed6d531/org-agenda-colorized-blocks.png"
    alt="org-agenda-colorized-blocks.png" />

and the image is rendered inline.

Could you provide a minimal reproducer for the issue you see?


  reply	other threads:[~2021-01-03 20:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03  9:12 Problems with attachment links in exported files Pablo Palazon
2021-01-03 20:46 ` Kyle Meyer [this message]
2021-01-03 21:53   ` Pablo Palazon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6tpd9zb.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pablo.palazon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).