emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Grant Rettke <gcr@wisdomandwonder.com>
To: Rainer M Krug <Rainer@krugs.de>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	Eric Brown <brown@fastmail.fm>
Subject: Re: Error Embedding SQL Source from code block into R Source of Another (noweb)
Date: Tue, 30 Sep 2014 08:36:32 -0500	[thread overview]
Message-ID: <CAAjq1mdFng334QiO907mySrNP4+z=Ks-VjLHWaFOpb9zeZbfEQ@mail.gmail.com> (raw)
In-Reply-To: <m2a95hr0re.fsf@krugs.de>

On Tue, Sep 30, 2014 at 3:05 AM, Rainer M Krug <Rainer@krugs.de> wrote:
> Eric Brown <brown@fastmail.fm> writes:

Like Rainier mentioned you might want to use [noweb] to tangle both
for output tangling and execution. My system is set up to tangle for
both eg:

This
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: query
#+begin_src sql
select
    *
from
    table
where
    x > 10
#+end_src

#+begin_src R :tangle output.R
input <- '
    «query»
'
#+end_src
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
produces this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
input <- '
    select
        *
    from
        table
    where
        x > 10
'
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
and

this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: msg
#+begin_src sql
Hello, world.
#+end_src

#+begin_src R :eval yes
print("«msg»")
#+end_src

#+NAME:
#+begin_example
[1] "Hello, world."
#+end_example
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

produces this

## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
╭────
│ Hello, world.
╰────

╭────
│ print("«msg»")
╰────

╭────
│ [1] "Hello, world."
╰────
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

http://orgmode.org/manual/noweb.html#noweb

  reply	other threads:[~2014-09-30 13:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30  0:39 Error Embedding SQL Source from code block into R Source of Another (noweb) Eric Brown
2014-09-30  8:05 ` Rainer M Krug
2014-09-30 13:36   ` Grant Rettke [this message]
2014-09-30 14:32     ` Eric Brown
2014-09-30 18:46       ` Grant Rettke
2014-09-30 19:15       ` Nick Dokos
2014-09-30 23:16         ` Grant Rettke
2014-10-01  2:23           ` Nick Dokos
2014-10-01 17:23             ` Grant Rettke
2014-10-01 17:43               ` Nick Dokos
2014-09-30 15:08 ` Charles Berry
2014-09-30 17:02   ` Eric Brown

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='CAAjq1mdFng334QiO907mySrNP4+z=Ks-VjLHWaFOpb9zeZbfEQ@mail.gmail.com' \
    --to=gcr@wisdomandwonder.com \
    --cc=Rainer@krugs.de \
    --cc=brown@fastmail.fm \
    --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).