[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Tangling src blocks to files as part of export
From: |
Rainer M Krug |
Subject: |
Re: [O] Tangling src blocks to files as part of export |
Date: |
Fri, 14 Nov 2014 09:39:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) |
Michael Weylandt <address@hidden> writes:
>> On Nov 13, 2014, at 10:54 AM, Michael Weylandt <address@hidden> wrote:
>>
>> Is it possible to have certain blocks tangled as part of export so
>> that they are available as input files to later source blocks?
>>
>> E.g.,
>>
>> #+BEGIN_SRC python :tangle hello.py
>> print "Hello World"
>> #+END_SRC
>>
>> #+BEGIN_SRC sh
>> python hello.py
>> #+END_SRC
>>
>> If I tangle before running, then the second code block will work; else, it
>> fails because 'hello.py' is not found. [1]
>>
>> I can run tangle and export in a row (and I have my own function to
>> do just that) but is there a native org way to do so?
>
> Adding org-babel-tangle to the org-export-before-processing-hook does
> the job, but I'd still be interested in knowing if there's a more
> official method.
I think this is the more-or-less official way of doing it - that's what
hooks are for: to do pre- and post-processing, which is exactly what you
want to do.
I like it actually.
Do you set the hook as a file local variable, and if yes, how?
Because this would be brilliant.
Cheers,
Rainer
>
>
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
signature.asc
Description: PGP signature