From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: why prepend "file://" to abs paths in html output? Date: Sun, 09 Jul 2017 09:37:44 +1000 Message-ID: <874lumfqk7.fsf@gmail.com> References: <87lgnz43qk.fsf@nicolasgoaziou.fr> <87h8yn3tsa.fsf@nicolasgoaziou.fr> <87bmou4u8a.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]:49302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTzIR-0006qb-L1 for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 19:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTzIQ-0004CR-Ea for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 19:37:55 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTzIQ-0004CG-8f for emacs-orgmode@gnu.org; Sat, 08 Jul 2017 19:37:54 -0400 Received: by mail-pg0-x242.google.com with SMTP id u62so8327936pgb.0 for ; Sat, 08 Jul 2017 16:37:54 -0700 (PDT) In-reply-to: <87bmou4u8a.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: Carsten Dominik , Org Mode , Kaushal Modi Ni Nicolas, I think I agree. If I export org files as HTML for use on my local system, I probably want 'real' links and file:/// is probably the right thing as I don't want to have to also install the files in a local web server. However, when I want to export files to HTML and have them served by a web server, file:/// is not the right thing. Perhaps we need a way to easily set a context for web exports. If the context is set, then use it, otherwise, use file:/// (actually, I thought this was already there, but it has been a while since I did html exports where links were necessary). Tim Nicolas Goaziou writes: > 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 someth= ing >> 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 Tim Cross