From: Rainer M Krug <Rainer@krugs.de>
To: Michael Weylandt <michael.weylandt@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Tangling src blocks to files as part of export
Date: Fri, 14 Nov 2014 09:39:19 +0100 [thread overview]
Message-ID: <m24mu2w4zs.fsf@krugs.de> (raw)
In-Reply-To: <871A2C12-586B-4E42-AEE9-31BFAA4C8EBF@gmail.com> (Michael Weylandt's message of "Thu, 13 Nov 2014 11:15:34 -0500")
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
Michael Weylandt <michael.weylandt@gmail.com> writes:
>> On Nov 13, 2014, at 10:54 AM, Michael Weylandt <michael.weylandt@gmail.com> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
prev parent reply other threads:[~2014-11-14 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 15:54 Tangling src blocks to files as part of export Michael Weylandt
2014-11-13 16:15 ` Michael Weylandt
2014-11-13 16:56 ` Fabrice Niessen
2014-11-14 8:39 ` Rainer M Krug [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m24mu2w4zs.fsf@krugs.de \
--to=rainer@krugs.de \
--cc=emacs-orgmode@gnu.org \
--cc=michael.weylandt@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).