* org-babel: Evaluating code blocks with noweb references but ":noweb tangle".
@ 2012-02-06 13:15 Yu
2012-02-06 13:31 ` Sebastien Vauban
0 siblings, 1 reply; 2+ messages in thread
From: Yu @ 2012-02-06 13:15 UTC (permalink / raw)
To: org-mode mailing list
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
Hello!
I sometimes have scenarios where I want to use the "noweb" feature in
interactive evaluation, but want the code to stay in its unexpanded
form on export. Currently I think, there is no way to achieve this and
I use tangling into a helper module file as a workaround (which is
reasonable for python anyway though).
Thus I'd appreciate a new option for the :noweb header argument; Sort
of an "in between" of ":noweb tangle" and ":noweb yes" ("expand noweb
references always except for exporting").
kind regards, Yu
PS: I have added example files to the email.
[-- Attachment #2: test.html --]
[-- Type: text/html, Size: 4440 bytes --]
[-- Attachment #3: test.org --]
[-- Type: application/octet-stream, Size: 1395 bytes --]
#+TITLE: Testing :noweb
#+AUTHOR: yu
#+EMAIL:
#+DATE: 2012-02-06 Mon
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en
#+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:
#+LINK_HOME:
#+XSLT:
# -*- org-confirm-babel-evaluate: nil -*-
* The Task Definition
# ------------------------------------------------------------------ #
#+begin_src python :noweb-ref task1 :results output
print "Hello World"
#+end_src
#+results:
: Hallo Welt
# ------------------------------------------------------------------ #
* Trying to Evaluate for :noweb tangle results in an error message.
# ------------------------------------------------------------------ #
#+begin_src python :noweb tangle :results output
<<task1>>
#+end_src
#+results:
# ------------------------------------------------------------------ #
* With :noweb yes it works fine, but the code is exported in expanded form.
# ------------------------------------------------------------------ #
#+begin_src python :noweb yes :results output
<<task1>>
#+end_src
#+results:
: Hallo Welt
# ------------------------------------------------------------------ #
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: org-babel: Evaluating code blocks with noweb references but ":noweb tangle".
2012-02-06 13:15 org-babel: Evaluating code blocks with noweb references but ":noweb tangle" Yu
@ 2012-02-06 13:31 ` Sebastien Vauban
0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2012-02-06 13:31 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Yu,
Yu wrote:
> I sometimes have scenarios where I want to use the "noweb" feature in
> interactive evaluation, but want the code to stay in its unexpanded
> form on export. Currently I think, there is no way to achieve this and
> I use tangling into a helper module file as a workaround (which is
> reasonable for python anyway though).
>
> Thus I'd appreciate a new option for the :noweb header argument; Sort
> of an "in between" of ":noweb tangle" and ":noweb yes" ("expand noweb
> references always except for exporting").
>
> kind regards, Yu
>
> PS: I have added example files to the email.
Try `:noweb no-export' which expands noweb references during tangling and
execution, but not during weaving (export).
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-06 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-06 13:15 org-babel: Evaluating code blocks with noweb references but ":noweb tangle" Yu
2012-02-06 13:31 ` Sebastien Vauban
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).