From mboxrd@z Thu Jan 1 00:00:00 1970 From: pinard@iro.umontreal.ca (=?utf-8?Q?Fran=C3=A7ois?= Pinard) Subject: Automatic inter Web-site linking ? Date: Fri, 06 Apr 2012 10:27:47 -0400 Message-ID: <868vi9szoc.fsf@iro.umontreal.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGA8s-00008I-Ep for emacs-orgmode@gnu.org; Fri, 06 Apr 2012 10:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGA8l-0006BQ-GG for emacs-orgmode@gnu.org; Fri, 06 Apr 2012 10:27:56 -0400 Received: from 206-248-137-202.dsl.teksavvy.com ([206.248.137.202]:51296 helo=mercure.progiciels-bpi.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGA8l-0006Av-Am for emacs-orgmode@gnu.org; Fri, 06 Apr 2012 10:27:51 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi everybody. Here I am with yet another need for an Org solution. There should not be much remaining! I'm sure they *all* say that... :-) I have a set of Org files with links to one another, for which I publish a dozen Web sites or so (using org-publish-project-alist). Whenever a link is within the same file, or a neighbouring file in the same directory (file:*.org style), links are properly converted to HTML references. When the links point to Org files which are a bit more away, "file:" is not converted to "html:", understandably. So I see myself writing either "file:" or "html:" links depending on the fact I know that Org will, or will not, do the expected conversion. The problem with writing "html:" is, of course, that I cannot follow these links while editing. So, I wonder if the conversion capabilities could not be augmented or automated somehow, allowing me to always use "file:" in the Org file themselves. A while ago, for each site within org-publish-project-alist, I already added a specification line: :top-url "http://SOME.WEB.SITE" as it seemingly did not break anything to do so, to save the information somewhere I could easily find it. I'd like to write some glue code to help this, maybe someone could hint me in the proper direction, or maybe suggest other avenues? I tried to read org-exp.el and org-html.el a bit, but they still are a bit too magical, I do not see how they work. Currently, here is what I would like to achieve: whenever there is a "file:*.org" link which is not translatable with the current algorithms, there is presumably some code somewhere, able to determine the site (from org-publish-project-alist) that would publish that referenced file. If that site is found, and if the site has a :top-url attribute, its value could provide a base to build the proper URL to translate the link. Would remain to hook the link conversion, likely within the current code in org-html.el; but as of now, I do not understand it enough to do (or at least, do cleanly). Fran=C3=A7ois