ntangle icon indicating copy to clipboard operation
ntangle copied to clipboard

[Feature Request] Parse #+INCLUDE lines

Open spicyriceball opened this issue 6 years ago • 2 comments

Sometimes org files are split into multiple org files. This could be due to multiple org files using the same parts, so it's sort of "DRY", or you simply have modular stuff you want to bring into one file. The INCLUDE word can be used to include lines from other files when exporting.

Currently, you have to do something like this with ntangle:

emacs file.org -q --batch -f org-org-export-to-org --kill
ntangle file.org.org
rm file.org.org

it could be nice if we could just do:

ntangle file.org

However, it does make sense if the maintainer doesn't want this in ntangle since the default org-babel-load-file (which ntangle sort of mimics?) doesn't have this behavior as far as I know. Thoughts on throwing this onto the backlog or nay?

spicyriceball avatar Apr 08 '20 20:04 spicyriceball

The #+include is a pretty loaded functionality.. it then opens up the need to support the full include functionality, which I am not open to. PR's are of course welcome.

But I don't mind adding functionality for just the basic #+include: /path/to/the/other/file.org.

kaushalmodi avatar Apr 08 '20 20:04 kaushalmodi

In summary:

Feature Example Will be supported by ntangle?
#+include: "~/my-book/chapter2.org" Yes
#+include: "~/my-book/chapter2.org" :minlevel 1 No
#+include: "~/.emacs" src emacs-lisp No
#+include: "~/my-book/chapter2.org" :minlevel 1 No
#+include: "~/.emacs" :lines "5-10" No
#+include: "~/.emacs" :lines "-10" No
#+include: "~/.emacs" :lines "10-" No
#+include: "./paper.org::*conclusion" :lines 1-20 No
#+include: "./paper.org::#theory" :only-contents t No

Examples are from the Org manual.

kaushalmodi avatar Apr 08 '20 20:04 kaushalmodi