[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?
From: |
Eric Schulte |
Subject: |
Re: [Orgmode] [BABEL] Tangling to a hierarchy of files? |
Date: |
Wed, 19 Jan 2011 00:22:04 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
"Charles C. Berry" <address@hidden> writes:
> On Wed, 19 Jan 2011, Christopher Maier wrote:
>
>> I've been experimenting with literate programming using Org mode recently
>> and am
>> really enjoying it. I am trying to figure out the best way to create a
>> nested
>> hierarchy of tangled files from a single Org file, and am not sure the best
>> way
>> to go about it.
>>
>> I know that, for example, this block, when tangled, will produce a file
>> "foo.clj" in the same directory as my Org file... so far so good.
>>
>> #+begin_src clojure :tangle foo.clj
>> (ns foo)
>>
>> (defn my-inc [x]
>> (+ x 1))
>> #+end_src
>>
>> However, I would like to be able to do something like this:
>>
>> #+begin_src clojure :tangle src/foo.clj
>> (ns foo)
>>
>> (defn my-inc [x]
>> (+ x 1))
>> #+end_src
>>
In addition to the solution Charles posted, it is possible to put
arbitrary elisp forms into header arguments, so the following
alternative to your block above will create the directory (if it doesn't
already exist) whenever the block is tangled or evaluated.
#+begin_src clojure :tangle (prog1 "src/foo.clj" (make-directory "src" "."))
(ns foo)
(defn my-inc [x]
(+ x 1))
#+end_src
Cheers -- Eric
- [Orgmode] [BABEL] Tangling to a hierarchy of files?, Christopher Maier, 2011/01/18
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Charles C. Berry, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?,
Eric Schulte <=
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Rainer M Krug, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Chris Maier, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Rainer M Krug, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Charles C. Berry, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Chris Maier, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Eric Schulte, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Chris Maier, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Eric Schulte, 2011/01/19
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Rainer M Krug, 2011/01/20
- Re: [Orgmode] [BABEL] Tangling to a hierarchy of files?, Chris Maier, 2011/01/20