Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

noweb style weaving in org-babel

I'm using Emacs 23 with Org 7.8.04. My code structure is as follows:

#+TITLE: hello, world!

#+BEGIN_SRC python :tangle yes :noweb yes
<<go_function>>
if __name__ == "__main__":
    go()
#+END_SRC

Define =go_function= as follows.

#+name:go_function
#+BEGIN_SRC python
def go:
    print "hello, world!"
#+END_SRC

When I tried to weave documentation, the <<go_function>> in the first code chunk is exported to html too so that I have two html exports of <<go_function>>. I'd like the <<go_function>> is exported as a link which points to the actual definition at the end of the document.How can I do that?

like image 290
Federico Magallanez Avatar asked Apr 29 '12 15:04

Federico Magallanez


1 Answers

Try changing :noweb yes to :noweb tangle. The manual is very helpful in cases like this (see http://orgmode.org/manual/noweb.html).

like image 105
eschulte Avatar answered Oct 14 '22 05:10

eschulte