We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
我编写了 Pweave http://mpastell.com/pweave,旨在生成动态报告并使用 noweb 语法。 它是一个纯 python 脚本,因此也可以在 Windows 上运行。 它不能解决您的缩进问题,但也许您可以为此进行修改,代码确实非常简单。
I have written Pweave http://mpastell.com/pweave, that is aimed for dynamic report generation and uses noweb syntax. It is a pure python script so it also runs on Windows. It doesn't fix your indent problem, but maybe you can modify it for that, the code is really quite simple.
社区事实上的标准是 IPython 笔记本。
Peter Norvig 演示了解决旅行商问题的算法的绝佳示例:https:/ /nbviewer.org/url/norvig.com/ipython/TSP.ipynb
列出的更多示例 https://github.com/jupyter/jupyter/wiki
The de-facto standard in the community is IPython notebooks.
Excellent example in which Peter Norvig demonstrates algorithms to solve the Travelling Salesman Problem: https://nbviewer.org/url/norvig.com/ipython/TSP.ipynb
More examples listed at https://github.com/jupyter/jupyter/wiki
我这样做了:
http://sourceforge.net/projects/pywebtool/
你可以获得任意数量的web/weave 产品将帮助您一次性构建文档和代码。
您可以非常轻松地编写自己的。 从 RST 源中取出 Python 代码块并进行组装并不是什么复杂的事情。 事实上,我建议您编写自己的 Docutils 指令来从 RST 源文档汇编 Python 代码。
您通过 docutils rst2html(或 Sphinx)运行 RST 以生成最终的 HTML 报告。
您可以在同一 RST 源上运行自己的实用程序来提取 Python 代码块并生成最终模块。
I did this:
http://sourceforge.net/projects/pywebtool/
You can get any number of web/weave products that will help you construct a document and code in one swoop.
You can -- pretty easily -- write your own. It's not rocket science to yank the Python code blocks out of RST source and assemble it. Indeed, I suggest you write your own Docutils directives to assemble the Python code from an RST source document.
You run the RST through docutils rst2html (or Sphinx) to produce your final HTML report.
You run your own utility on the same RST source to extract the Python code blocks and produce the final modules.
你可以使用 org-mode 和 babel-tangle。
这非常有效,因为您可以将 :noweb-ref 赋予源块。
这是一个最小的示例:激活 org-babel-tangle ,然后将其放入文件
noweb-test.org
中:您还可以使用标题的属性来提供 noweb-ref。 然后,它甚至可以自动将多个源块连接到一个 noweb 引用中。
将
:results output
添加到第二个块的#+begin_src
行,以便在您在第二个块中点击Cc Cc
时查看该块下的打印结果堵塞。You could use org-mode and babel-tangle.
That works quite well, since you can give :noweb-ref to source blocks.
Here’s a minimal example: Activate org-babel-tangle, then put this into the file
noweb-test.org
:You can also use properties of headlines for giving the noweb-ref. It can then even automatically concatenate several source blocks into one noweb reference.
Add
:results output
to the#+begin_src
line of the second block to see the print results under that block when you hitC-c C-c
in the block.您可能会发现 noweb 3 在 Windows 上构建起来更容易。 它被设计为比标准 noweb 更便携。
You might find noweb 3 easier to build on Windows. It was designed to be more portable than standard noweb.
发现这个工具很有用:https://github.com/bslatkin/pyliterate
Found this tool to be useful: https://github.com/bslatkin/pyliterate
另请参阅我的上一个 LP 工具:https://code.google.com/archive/ p/nano-lp/。 它不需要特殊的输入格式,支持 Markdown/MultiMarkdown、reStructuredText、OpenOffice/LibreOffice、Creole、TeX/LaTeX,并具有超轻、干净的语法 - 不再有神秘的识字程序。
See also my last LP tool: https://code.google.com/archive/p/nano-lp/. It does not requires special input format, supports Markdown/MultiMarkdown, reStructuredText, OpenOffice/LibreOffice, Creole, TeX/LaTeX and has super light and clean syntax - no more cryptic literate programs.