emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automatic inter Web-site linking ?
@ 2012-04-06 14:27 François Pinard
  2012-04-09 12:53 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: François Pinard @ 2012-04-06 14:27 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Automatic inter Web-site linking ?
  2012-04-06 14:27 Automatic inter Web-site linking ? François Pinard
@ 2012-04-09 12:53 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-04-09 12:53 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

pinard@iro.umontreal.ca (François Pinard) writes:

> 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).

Did you try using link abbreviations?

From the manual:

,----
| 4.6 Link abbreviations
| ======================
| 
| Long URLs can be cumbersome to type, and often many similar links are
| needed in a document.  For this you can use link abbreviations.  An
| abbreviated link looks like this
| 
|      [[linkword:tag][description]]
`----

If that doesn't fit your need because you need internal links to get you
to the Org page, then I'll need a more "actionable" example.

HTH, thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-09 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-06 14:27 Automatic inter Web-site linking ? François Pinard
2012-04-09 12:53 ` Bastien

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).