Questions tagged [noweb]
22 questions
6
votes
2 answers
Insert noweb references with completion
I have discovered the noweb syntax, and in particular how it can be used in org source blocks, very recently, and I have grown quite fond of it.
But inserting the references (is there a better term?) seems to be unnecessarily painful: it seems that…

T. Verron
- 4,233
- 1
- 22
- 55
5
votes
2 answers
Noweb references in sh blocks breaks the syntax highlighting
I use noweb references inside sh code blocks, for example:
#+begin_src sh
echo "test"
<>
echo "test"
#+end_src
But this causes syntax highlighting to be broken because << gets interpreted as here document by the sh syntax…

isamert
- 103
- 4
5
votes
2 answers
How to disable noweb prefix lines?
This says that
Noweb insertions now honor prefix characters that appear before <>.
And because of that trying to use
#+BEGIN_SRC clojure :noweb-ref dep-cljsbuild
[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5" :exclusions…

Ruslan Prakapchuk
- 151
- 2
4
votes
1 answer
Report missing noweb references in org-babel
In org-babel, is there a way for checking for missing noweb references <<...>> or for throwing an error if a reference is missing?
For example in the following I have mistyped the name of the referenced code block. Tangling via C-c C-v f then…

Andrew Swann
- 3,436
- 2
- 15
- 43
3
votes
1 answer
noweb function call with variable arguments
I get error "reference y not found in this buffer" when trying to evaluate cubed-plus-cubed:
#+NAME: cubed
#+BEGIN_SRC python :var x=3
return x * x * x
#+END_SRC
#+RESULTS: cubed
: 27
#+NAME: cubed-plus-cubed
#+BEGIN_SRC python :var y=0 :noweb…

user3496846
- 378
- 1
- 10
3
votes
1 answer
How to get babel code blocks to evaluate parameters when called from a noweb ref?
I have an interesting problem that I am sure there must be a simple answer to if I can find the right syntax.
Essentially, as outlined below, I have a simple sh code block that prints a variable that is declared as part of #+begin_src.
#+name:…

Matt Innes
- 250
- 1
- 7
2
votes
1 answer
Nested noweb in org src blocks
I have the following code blocks:
Block 1 is just one line. This is a MWE. In reality, I have several lines in block 1.
#+name: block1
#+begin_src python :noweb no :exports none
print("Block 1")
#+end_src
Block 2 has also been reduced for the sake…

Vaibhav Karve
- 23
- 3
2
votes
1 answer
org-mode: How can noweb handle a multiple line output
I have a code chunk in my document that I want to use as a list of patterns to search for with grep.
If I were just writing a script without org-babel, I could write.
a="ar
er
ir
or
ur"
printf "Four\nscore\nand\nseven\nyears\nago" | grep -F…

njc
- 63
- 5
2
votes
0 answers
noweb reference aware org-edit-special
Is there a way of splitting a src block into several blocks while keeping them together with noweb reference syntax and editing them using org-edit-special in such a way that would take into account all the noweb referenced blocks?

Yuval Langer
- 121
- 4
1
vote
1 answer
Export an orgmode buffer without expanding noweb references?
Normally, when I use orgmode's export function on a buffer that contains noweb references, they get expanded, resulting in lots of duplicated code throughout the exported HTML document.
Is there a way to export an orgmode buffer without expanding…

Daniel Ziltener
- 244
- 1
- 8
1
vote
1 answer
How to pass newline ("\n") string to noweb <>
Trying to pass multiline argument to Org code block. If make direct call of block then it's Ok.
But when call it through noweb ref then Error raised
#+NAME: pr
#+BEGIN_SRC elisp :results value :var n="a\nb\nc"
"%p" n
#+END_SRC
#+RESULTS: pr
: a
:…

Dima Fomin
- 143
- 5
1
vote
0 answers
How can I use #+CALL with multiple arguments?
I'm trying to learn how to use the noweb syntax and advance my knowledge on the possibilities of org babel. For that, I'm trying to get the following an example to work that 1. uses noweb syntax and 2. calls the tangled function later on in the…

Daniel
- 3,563
- 16
- 41
0
votes
0 answers
Can a noweb block be directed to a specific output block?
I know you can give a block the property :noweb-ref give it a reference name like foo and then in another noweb block you can refer to the reference block with <>. However this means that for every block tagged with :noweb-ref I then need to…

Ian Pringle
- 123
- 6
0
votes
0 answers
In Elisp, how can I insert an org-babel JSON block into a variable with noweb?
In Elisp, I want to insert the contents of the "gazonk" JSON block into a variable.
#+name: gazonk
#+begin_src json
{
xyzzy "
}
#+end_src
, but I just get "End of file during parsing"
#+BEGIN_SRC elisp :noweb yes
(setq example-data…

Jason Hunter
- 519
- 2
- 9
0
votes
2 answers
How to pass a variable to a LaTeX code block?
I'd like to set a variable to be expanded in several LaTeX code blocks. For the sake of simplicity, there is only one in this case, foo. :header-args :var is ignored: I presume because LaTeX does not support interactive evaluation? The best I could…
user19777