emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Feature proposal: Triple square brackets to create a link to a f


From: John Kitchin
Subject: Re: [O] Feature proposal: Triple square brackets to create a link to a file AND include the file
Date: Thu, 27 Sep 2018 12:55:51 -0400
User-agent: mu4e 1.0; emacs 25.3.1

You can get essentially what you want with a custom org-link in org-9 or
later.

#+BEGIN_SRC emacs-lisp
(org-link-set-parameters
 "wiki"
 :follow (lambda (path) (find-file path))
 :export (lambda (path description backend)
           ;; do this for all exports
           (with-temp-buffer
             (insert-file-contents path)
             (buffer-string))))
#+END_SRC

If you need extra syntax to support the lines below, see
http://kitchingroup.cheme.cmu.edu/blog/2015/02/05/Extending-the-org-mode-link-syntax-with-attributes/
for an approach to do that with the existing link syntax, so it might
look like:

[[wiki:dir/file :lines "5-10"]]

This link is clickable and inserts the file at the link point in the
export.



ST <address@hidden> writes:

> Hello,
>
> it would be nice to be able to make URIs to INCLUDEd files clickable. In
> order to make them also lightweight, readable and corresponding to
> current link syntax, I would suggest the following:
>
> [[[dir/file]]]
> [[[dir/file]] :lines "5-10"]
> [[[dir/file][My file]] :lines "5-10"]
>
> as clickable, including links.
>
> What do you think? Or maybe there is already something like this, if yes
> - how can I achieve the same?
>
> Thank you!


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

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