From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: why prepend "file://" to abs paths in html output? Date: Sat, 08 Jul 2017 21:13:57 +0200 Message-ID: <87bmou4u8a.fsf@nicolasgoaziou.fr> References: <87lgnz43qk.fsf@nicolasgoaziou.fr> <87h8yn3tsa.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTvB4-0001mv-TV for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 15:14:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTvB3-0005dy-Vq for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 15:14:02 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:c:538::194]:49242) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dTvB3-0005d7-PW for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 15:14:01 -0400 In-Reply-To: (Carsten Dominik's message of "Sat, 8 Jul 2017 16:19:12 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Carsten Dominik Cc: Org Mode , Kaushal Modi Hello, Carsten Dominik writes: > I think it can be useful to write file: in the org-mode file, to make a > clear distinction from internal links. But once it is clear that somethi= ng > is a link to a file, I guess you are right that it might not be needed in > HTML. We will see what breaks..... Thinking about it, we should probably not remove the "file://" prefix. I cannot think of any situation where [[/absolute/path/to/file]] would match something like "", because "/" never matches web root directory. IOW, to re-use the OP's example, [[/static/images/unicorn.jpg]] is never a valid Org link, in the sense that it points to a non-existing file. Since the OP is writing a link only valid during HTML export, he might as well write raw HTML. Note that that "file:///static/images/unicorn.jpg" is not useful either, but at least it is logical. The only situation where we might do something is during publishing, when we know what web root directory =E2=80=93 i.e., base directory =E2=80= =93 is. In that case, we could replace absolute file names starting with web root dir as root-relative URL. WDYT? Regards, --=20 Nicolas Goaziou