emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [org-babel] Dynamic Tangle?
Date: Mon, 6 Dec 2010 22:57:58 -0600	[thread overview]
Message-ID: <AANLkTin_QDLQwPJi9xhY8+U7nz56Og7wCiVhtF+5gtpw@mail.gmail.com> (raw)

I'm preparing a presentation and I'm getting using tangle to show code /and/
produce working code examples -- this is really cool.

It is possible to define a "template" and pass code blocks to it?
For example: (Using pseudo-org-babel-code for brevity)

#+template
header code
<<code_that_is_passed_to_me>>
footer code

#+example1 :render #+template with 1111111
1111111111

#+example2 :render #+template with 222222
222222222

The tangled output would be:

header code
11111111111
footer code

header code
2222222222
footer code

I'm already able to use org-babel like below, but I have to
put a <<footer>> and a <<header>> in each code block.

Here's my existing setup:
#+header
header code

#+footer
footer code

#+example1
<<header>>    <-- I have to specify these <<header>> and <<footer>> in
each code block
11111111111
<<footer>>

#+example2
<<header>>
2222222222
<<footer>>

Thanks again for org-babel -- I'll post my presentation when I get it done.

--Nate

             reply	other threads:[~2010-12-07  4:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07  4:57 Nathan Neff [this message]
2010-12-13 20:58 ` [org-babel] Dynamic Tangle? Eric Schulte

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=AANLkTin_QDLQwPJi9xhY8+U7nz56Og7wCiVhtF+5gtpw@mail.gmail.com \
    --to=nathan.neff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).