From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: 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 Message-ID: References: <1538048127.1873.26.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Za8-0000HK-PD for Emacs-orgmode@gnu.org; Thu, 27 Sep 2018 12:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Za4-0001Is-G6 for Emacs-orgmode@gnu.org; Thu, 27 Sep 2018 12:56:04 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:39081) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5Za2-0001Hg-Gd for Emacs-orgmode@gnu.org; Thu, 27 Sep 2018 12:55:58 -0400 Received: by mail-ed1-x52d.google.com with SMTP id h4-v6so5674483edi.6 for ; Thu, 27 Sep 2018 09:55:57 -0700 (PDT) In-reply-to: <1538048127.1873.26.camel@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: ST Cc: Emacs-orgmode@gnu.org 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 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