Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi writes: > I meant "Would it be OK to have ox-hugo.el define a link abbreviation like > `hugo-static:' for the user?" That way, each user of ox-hugo.el does not > have to do that in their configs. Anything goes, but I'm quite certain there's a better way. > For static site generator

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:55 AM Nicolas Goaziou wrote: > Kaushal Modi writes: > > > Hmm. Thanks for that hint. Would it be OK to define backend-specific link > > abbreviations? > > I don't think so. > > Back-end are able to manipulate links the way they want without Org core > interfering. IOW,

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi writes: > Hmm. Thanks for that hint. Would it be OK to define backend-specific link > abbreviations? I don't think so. Back-end are able to manipulate links the way they want without Org core interfering. IOW, this black magick should operate whitin "ox-hugo.el" itself, IMO. BTW,

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:39 AM Nicolas Goaziou wrote: > > There is only one possible interpretation of this: look for the file at > "/images/image.png", which probably doesn't exist. > I agree. It's definitely less confusing to an unknowing user with that strict definition. ISTM you are lookin

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Hello, Brett Viren writes: > Nikola source wants this layout: > > /path/to/my/nikola/posts/my-blog-post.org > /path/to/my/nikola/images/unicorn.jpg > > The Org source generates to HTML which will be found at this URL path: > > /mysiteroot/posts/my-blog-post/index.html > > So, right now, ei

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > #+HTML_LINK_ROOT: /tmp/site/static/ > > An =image.png= exists as =/tmp/site/static/images/image.png=. > > * This is how the image links should have worked with the link root already > specified > [[/images/image.png]] There is only one possible interpretation of th

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Tim Cross
Having seen the other posts on this, I think I'll need to spend more time thinking about this and the various use cases. There is something I'm having trouble putting my finger on which doesn't feel quite right, but I feel I need to look more deeply into the whole idea of how to export links gener

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hello, On Mon, Jul 10, 2017 at 3:54 PM Kaushal Modi wrote: > Hi Nicolas, > > I tried out the patch, and my comments are in the MWE below. > > I have this MWE that explains the "would like to have" vs "what this patch > gives us": > > = > #+TITLE: ox-html root dir > #+OPTIONS: toc:nil > #+STA

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hi Nicolas, I tried out the patch, and my comments are in the MWE below. On Mon, Jul 10, 2017 at 9:59 AM Brett Viren wrote: > Is this saying "subtract the value of 'html_link_root' from the Org link > to make its URL"? > > If so, I think this would not be general enough to help some cases. For

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Brett Viren
Hi Nicolas, Nicolas Goaziou writes: > So, basically, upon exporting the following document to HTML: > > #+html_link_root: /tmp/ > [[/tmp/unicorn.jpg]] > > the link becomes > > Is this saying "subtract the value of 'html_link_root' from the Org link to make its URL"? If so, I think this

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > Can you please attach the patch? Oops. Here it is. Regards, -- Nicolas Goaziou >From 6eed5dcd4e585dd32e52571189cf395b1a532310 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 9 Jul 2017 12:40:49 +0200 Subject: [PATCH] ox-html: Implement root directory

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hello, On Sun, Jul 9, 2017, 6:45 AM Nicolas Goaziou wrote: > > The following patch implements `org-html-root', which allows to export > file links as root-relative URL. Can you please attach the patch? I'm not sure the docstring is clear > enough, tho. > Also, HTML publishing process alwa

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-09 Thread Nicolas Goaziou
Hello, Tim Cross writes: > 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). The following pa

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Tim Cross
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 b

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Nicolas Goaziou
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 something > is a link to a file, I guess you are right that it might not be needed in > HTML. We will see what breaks

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Carsten Dominik
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 something is a link to a file, I guess you are right that it might not be needed in HTML. We will see what breaks. Carsten On Sat, Jul 8, 2017 at 4:08 PM

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I don't see why "file://" would be useful in html exports OK. Il remove the file:// scheme specifications then. > (or pdf, md, etc). Well, those are not related to network based protocols. Does it really make a difference in those cases? Regards, -- Nicolas Go

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Kaushal Modi
On Sat, Jul 8, 2017, 6:35 AM Nicolas Goaziou wrote: > Let me ask this the other way: is there any situation where "file://" > prefix is desirable? > I don't see why "file://" would be useful in html exports (or pdf, md, etc). It is probably needed only in org to org exports. > -- Kaushal Modi

Re: [O] why prepend "file://" to abs paths in html output?

2017-07-08 Thread Nicolas Goaziou
Hello, Matt Price writes: > in org-html-link local links of the form > > "/some/path/to/file" > > are rewritten as > > "file:///some/path/to/file". > > This makes it difficult to write root-relative URL's in the way that one > might expect to be able to (so that export produces links like > > >

[O] why prepend "file://" to abs paths in html output?

2017-07-07 Thread Matt Price
in org-html-link local links of the form "/some/path/to/file" are rewritten as "file:///some/path/to/file". This makes it difficult to write root-relative URL's in the way that one might expect to be able to (so that export produces links like Is this really the most desirable behaviour? In