emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Tangling include files


From: Charles C. Berry
Subject: Re: [O] Tangling include files
Date: Wed, 23 Nov 2016 21:22:08 -0800
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

On Thu, 24 Nov 2016, Harry Butterworth wrote:

I tried org-org-export-to-org which puts everything into a single document
but it strips the :tangle parameters out so a subsequent tangle doesn't
generate any source code.


You might try this. Put this at the *top* of your file:

--8<---------------cut here---------------start------------->8---

#+PROPERTY: header-args :eval never-export

#+NAME: tangle file
#+BEGIN_SRC emacs-lisp :eval yes :exports results
(org-babel-tangle)
#+END_SRC

--8<---------------cut here---------------start------------->8---

Type C-c C-c on the property line to refresh it.

Now export. Type 'y' in reply to the query to eval the `tangle file' src block and again to the `discard edits' query.

Even exporting to a buffer should be fine. You do not really want the exported document, you just want to force the inclusions to take place and then run that src block.

This should work, because `org-export-as' will expand all the include's before running babel. If the above block runs before any others, then the :tangle headers will still be in place.

In fact you could create a separate file, place all the above in it and add one line at the bottom to include the top level org file you want to tangle from. Then export that.

HTH,

Chuck



reply via email to

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