在org-babel编织的noweb风格

Fed*_*nez 5 emacs literate-programming org-mode org-babel

我正在使用Emacs 23和Org 7.8.04.我的代码结构如下:

#+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
Run Code Online (Sandbox Code Playgroud)

当我尝试编写文档时,<<go_function>>第一个代码块中的第一个代码块也被导出为html,因此我有两个html导出<<go_function>>.我希望将 <<go_function>>导出为链接,指向文档末尾的实际定义.我该怎么做?

小智 7

尝试:noweb yes改为:noweb tangle.在这种情况下,该手册非常有用(参见http://orgmode.org/manual/noweb.html).