From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sKHGHgE98l+CKwAA0tVLHw (envelope-from ) for ; Sun, 03 Jan 2021 21:54:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KLuYGgE98l++BwAAB5/wlQ (envelope-from ) for ; Sun, 03 Jan 2021 21:54:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 486B094036A for ; Sun, 3 Jan 2021 21:54:09 +0000 (UTC) Received: from localhost ([::1]:58060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwBKC-0006ye-9m for larch@yhetil.org; Sun, 03 Jan 2021 16:54:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwBJi-0006yY-1c for emacs-orgmode@gnu.org; Sun, 03 Jan 2021 16:53:38 -0500 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:43871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwBJf-0001ce-Bp for emacs-orgmode@gnu.org; Sun, 03 Jan 2021 16:53:37 -0500 Received: by mail-yb1-xb34.google.com with SMTP id y128so24299770ybf.10 for ; Sun, 03 Jan 2021 13:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mDylJvBJpvww3tThQ5PuWHeERAU/1sHkg4CRtdo6FR8=; b=HyHsosT8cBzc7nBXODurjA/ugoKOWH7uIB1bIfhmkCffCS7xz1/YgSZok5JZrERp5p QX39ITHnZkoDHJHSE9gUn0U6Qx5j2MYR+WHDSAT7sNhUkCbf0GOZ+BFK1pru1z58Y4OF bZpP5CS2uV9rOiCgDzRXF736mXgrl3RrzgxwmBQzA8AXH9L1ZqnAlkLkI895PMGtzzg9 KSB8FyyBY588NKmaPBkP6MX31oIc+5DIKamhMKNHfa7DrlK4iO17WS0KaEA0F1B08BUe KzeO2prPS7uO+YE/BUZ0a2V4Jie3Qx7bZBSccdmQmINSB0SIeVvB4IF4lCTsC8H64aME cDDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mDylJvBJpvww3tThQ5PuWHeERAU/1sHkg4CRtdo6FR8=; b=jEMZ7Zmf1MVh8HI3AtJTpff2qqVFcmF55P2aFWswIyOKzidhta7aXoBmXoFkWnFBky GRjBF1roL+uUZLjTQOPH4jfqCCeeNQOE+apHR76rE5RNyVkst1WiNkbjgHS8ElCMnG1m TiapKYvn8u3JmmPRmPE4r7qCL1DSNkXs8882upUUMkRgVmLWjWRTkLojz23T10Ylh07I 9NvtfgV9VCipX9tP5cPCqOTdS7Y/rhQ9N54GXmCbNfxSxRVmYGwBkyCIEE6vacsph7Ai CxtndOjALxQE6ve7bnkItjbLdxjnTwx+HRUz36jckcRpIz2dl9H4HEZ5OBbusq1h8E2k eRvg== X-Gm-Message-State: AOAM532/tm4aaSMoTmtQH1PBBQhotujXcKnUw8q+sK0B/kOokzAO60XO OWWG++3sBl1oS/njOwS3LPSeGpPAK9/1M//v+jHHi9StG4R1Bg== X-Google-Smtp-Source: ABdhPJzWDmMLmOyc6KIyV1cimGNwbsk1ZwU61tyWzFoT2KxCw7bIag1a26wflONiiolDF//+GCp2QjNUlLX9kRw+okY= X-Received: by 2002:a25:bccf:: with SMTP id l15mr90286227ybm.272.1609710814501; Sun, 03 Jan 2021 13:53:34 -0800 (PST) MIME-Version: 1.0 References: <87a6tpd9zb.fsf@kyleam.com> In-Reply-To: <87a6tpd9zb.fsf@kyleam.com> From: Pablo Palazon Date: Sun, 3 Jan 2021 22:53:23 +0100 Message-ID: Subject: Re: Problems with attachment links in exported files To: Kyle Meyer Content-Type: multipart/alternative; boundary="0000000000004a1cef05b80601bb" Received-SPF: pass client-ip=2607:f8b0:4864:20::b34; envelope-from=pablo.palazon@gmail.com; helo=mail-yb1-xb34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 486B094036A X-Spam-Score: -4.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: Fb8bY+3x0EpN --0000000000004a1cef05b80601bb Content-Type: text/plain; charset="UTF-8" Thanks Kyle!, While I was reading your message I checked that my org-mode version was outdated. I configured org-mode repository, but I didn't install the latest org-mode version. So I'm sorry for that. I've tried your snippet, and it works perfectly. Thank you for you time, I appreciate it. On Sun, Jan 3, 2021 at 9:46 PM Kyle Meyer wrote: > 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 > > > 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? > --0000000000004a1cef05b80601bb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Kyle!, While I was reading your message I checked t= hat my org-mode version was outdated. I configured org-mode repository, but= I didn't install the latest org-mode version. So I'm sorry for tha= t. I've tried your snippet, and it works perfectly. Thank you for you t= ime, I appreciate it.

On Sun, Jan 3, 2021 at 9:46 PM Kyle Meyer <kyle@kyleam.com> wrote:
Pablo Palazon writes:

> Hi everyone!
>
> I've had a trouble with attachment type link on exporting. I confi= gured
> 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-l= inks)
>
> 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.=C2=A0 The snippet you= show
is in the Org repo, specifically in org-attach.el:

=C2=A0 https://code.o= rgmode.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, bu= t
I wasn't able to trigger the issue with inline links.=C2=A0 Here's = what I
tried using the default configuration on the master branch (c3888a8b7):

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

That output includes

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

and the image is rendered inline.

Could you provide a minimal reproducer for the issue you see?
--0000000000004a1cef05b80601bb--