简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM