From mboxrd@z Thu Jan 1 00:00:00 1970 From: David O'Toole Subject: Re: configurable link export Date: Sat, 20 May 2006 09:01:56 -0400 Message-ID: References: <446E1D82.4060806@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FhR5p-0001bB-3V for emacs-orgmode@gnu.org; Sat, 20 May 2006 09:02:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FhR5n-0001az-QK for emacs-orgmode@gnu.org; Sat, 20 May 2006 09:02:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FhR5n-0001aw-LF for emacs-orgmode@gnu.org; Sat, 20 May 2006 09:02:03 -0400 Received: from [66.249.82.192] (helo=wx-out-0102.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FhR9L-0003XG-0a for emacs-orgmode@gnu.org; Sat, 20 May 2006 09:05:43 -0400 Received: by wx-out-0102.google.com with SMTP id i29so506727wxd for ; Sat, 20 May 2006 06:02:02 -0700 (PDT) In-Reply-To: (Carsten Dominik's message of "Sat, 20 May 2006 13:01:20 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten Dominik writes: > Anyway, I have been thinking about your argumentation and come to the > conclusion that this is an issue I would like to push almost entirely > onto Davids table. David, are you listening? :-) Yes :-) > way, would be that the structure and content of > org-publish-project-alist is used to fully automatically determine the > validity of a link. not trivial to implement, but possible and a nice > challenge. I have been thinking about inter-file links in preparation for implementing some of the more advanced features for org-publish (page rewriting, sitemap generation, etc) and I think this will be very simple to straighten out. All we need is for people to specify a property called :link-base that is the prefix for a URL. For example, if :publishing-directory is "/ssh:user@host:~/public_html/images", the user should probably set the :link-base to "/images" or "http://foosite.org/images" Given this one extra piece of information, then it is a simple matter for the :link-transform function to actually generate proper URLs (instead of simply validating them.) This would free projects from the requirement that the web server must have the exact same directory layout as your local project files. This would allow, as you say, for link targets to be validated and transformed automatically, given just the structure and contents of org-publish-project-alist. I will work on this and let you know how it goes. Austin--- how does this sound? >> When I create local org files, I link to whatever files on my disk >> are relevant and useful. When I publish those org files, some of >> the org links (like to other published org files) still work and >> make sense as html links. Others (like links to local documents or >> directories) don't make any sense when published-- the resources >> they pointed to on the local system aren't on the remote filesystem >> that hosts the html pages. >> >> To be more specific, I maintain a directory ~/notes/ and a directory >> ~/blog/, each with a bunch of org files underneath it. I then use >> org-publish to generate the html files, which are then uploaded to >> my website. Crucially, this same directory structure is mirrored at >> my website, so local org links between those files work perfectly as >> html links when they are published and uploaded. >> >> I'd love to be able to specify that I want all org links of >> [file:///home/aufrank/notes/*] and [file:///home/aufrank/blog/*] to >> be exported as full html links, and exclude org links to any other >> files on my filesystem at export time. >> >> I think that David has established a good system for including and >> excluding files during publishing. Org-publish first generates a >> list of files to publish based on regex matching of the extensions >> of files in a directory. These are filtered through a regex-based >> exclude list, and then individual files can be added back in with an >> include list. >> >> Applying this strategy to link export, I might want to have >> something like the following in my org-config.el: >> >> (setq org-export-links-extension "org\\|txt" >> org-export-links-exclude "~/*" >> org-export-links-include ("~/notes/", "~/blog/")) >> >> This would result in exporting all of the .org and .txt files in >> ~/notes/ and ~/blog/ as working links in html files, but would >> ignore links in org files to anything else in my home directory >> during export. >> >> There's certainly a question about how org links that are not >> exported as html links should be handled. I would actually be fine >> with just exporting the double-bracketed notation, but I bet there >> are better ideas out there. >> >> Thanks again for the org suite, >> /au >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >> > > -- > Carsten Dominik > Sterrenkundig Instituut "Anton Pannekoek" > Universiteit van Amsterdam > Kruislaan 403 > NL-1098SJ Amsterdam > phone: +31 20 525 7477 > > > > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- Dave O'Toole dto@gnu.org