emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brett Viren <bv@bnl.gov>
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: Nick Dokos <ndokos@gmail.com>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: most robust linking practices?
Date: Fri, 17 Jan 2014 10:19:55 -0500	[thread overview]
Message-ID: <ir4iotioctg.fsf@lycastus.phy.bnl.gov> (raw)
In-Reply-To: <CAJ51ETpKDC-eYkNzs9-EJpgK93KOeadq5oNXp+9AEqRD2a6p9w@mail.gmail.com> (John Kitchin's message of "Fri, 17 Jan 2014 09:43:44 -0500")

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

Hi John,

John Kitchin <jkitchin@andrew.cmu.edu> 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 #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2014-01-17 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 21:09 most robust linking practices? John Kitchin
2014-01-16 22:32 ` Nick Dokos
2014-01-17 14:43   ` John Kitchin
2014-01-17 15:19     ` Brett Viren [this message]
2014-01-17 15:47     ` Nick Dokos
2014-01-19 20:37       ` John Kitchin

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=ir4iotioctg.fsf@lycastus.phy.bnl.gov \
    --to=bv@bnl.gov \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    --cc=ndokos@gmail.com \
    /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).