emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] most robust linking practices?


From: Brett Viren
Subject: Re: [O] most robust linking practices?
Date: Fri, 17 Jan 2014 10:19:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi John,

John Kitchin <address@hidden> writes:

> The files are all on a unix file system served over nfs, so everyone
> has the same / root. the users (students) have read access to my
> files.
>
> I am working towards creating "packages" of notes in org-mode (they
> might even be installed as emacs packages) for the courses that I
> teach. Having relative paths within a package certainly makes sense. I
> would like to link to notes in other packages too, as the courses are
> related, and build on each other. but I won't know in advance where
> those get installed. It sounds like those packages will have to have
> some variables configured to make that work out.

How about defining a slew of links in org-link-abbrev-list.  Say, one
for each set of class notes.

Maybe you'd maintain two copies of such a list, one that assumes your
shared file system is being used and one that assumes some layout
convention in the user's home directory.  Your users could pick the best
one or use them as a starting point for their own customization.

The fact that the link definitions may contain inline lisp functions may
help to organize this.

I guess you would need some way to update your reader/user's copy of the
list as it evolves.  Immediately, I don't have any ideas about that.

I've started to use this approach a little.  So far, just to reference
some common external links.  Here's my setup:

#+BEGIN_SRC elisp
;; Custom external links
;; http://orgmode.org/manual/Adding-hyperlink-types.html#Adding-hyperlink-types
;; http://orgmode.org/manual/Link-abbreviations.html#Link-abbreviations
(defun bv-link-resolve-github (tag)
  (replace-regexp-in-string ":" "/blob/master/" tag))

(setq org-link-abbrev-alist
      '(
        ("ghsite" . "https://github.com/brettviren/%h";)
        ("ghfile" . "https://github.com/brettviren/%(bv-link-resolve-github)")
        ("dbtrac" . "http://dayabay.ihep.ac.cn/tracs/dybsvn/ticket/%h";)
        ))
#+END_SRC

-Brett.

Attachment: pgp6cQk_kaJoA.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]