emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pinard@iro.umontreal.ca (François Pinard)
To: emacs-orgmode@gnu.org
Subject: Automatic inter Web-site linking ?
Date: Fri, 06 Apr 2012 10:27:47 -0400	[thread overview]
Message-ID: <868vi9szoc.fsf@iro.umontreal.ca> (raw)

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çois

             reply	other threads:[~2012-04-06 14:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 14:27 François Pinard [this message]
2012-04-09 12:53 ` Automatic inter Web-site linking ? Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=868vi9szoc.fsf@iro.umontreal.ca \
    --to=pinard@iro.umontreal.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).