emacs-orgmode
[Top][All Lists]
Advanced

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

Re: tangling from multiple files


From: Berry, Charles
Subject: Re: tangling from multiple files
Date: Wed, 18 Mar 2020 22:10:01 +0000


> On Mar 17, 2020, at 4:21 PM, David Bremner <address@hidden> wrote:
> 
> 
> I've seen this question around e.g. stack overflow, but none of the
> answers I found seems really satisfactory.
> 
> I'd like to share a set of begin_src / end_src blocks in a.org between
> b.org and c.org; in particular b.org and c.org contain noweb references
> to names defined in a.org. Is there a better way than using
> (org-babel-lob-ingest "a.org")? This seems a bit clunky, requiring
> manual action every time a.org changes.
> 


Put 

#+include: ./a./org

directives in b.org and c.org

You might want to put the directives inside a non-exported drawer. See 
`org-export-with-drawers’  docstring.

HTH,

Chuck

> For example, here is a.org
> 
> #+name: x.scm
> #+begin_src scheme
> (define x 1)
> #+end_src
> 
> #+name: y.scm
> #+begin_src scheme
> (define y 2)
> #+end_src
> 
> and here is b.org. You can imagine c is similar, but maybe swaps the
> order of x and y
> 
> #+begin_src scheme :tangle "b.scm" :noweb strip-export
> <<x.scm>>
> <<y.scm>>
> #+end_src
> 
> # Local Variables:
> # eval: (org-babel-lob-ingest "a.org")
> # End:
> 
> 


reply via email to

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