【问题标题】:noweb style weaving in org-babelorg-babel 中的 noweb 样式编织
【发布时间】:2012-04-29 15:28:52
【问题描述】:

我正在使用 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

当我尝试编织文档时,第一个代码块中的&lt;&lt;go_function&gt;&gt; 也被导出为 html,因此我有两个&lt;&lt;go_function&gt;&gt; 的 html 导出。我想将&lt;&lt;go_function&gt;&gt; 导出为指向文档末尾实际定义的链接。我该怎么做?

【问题讨论】:

    标签: emacs org-mode literate-programming org-babel


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多