问题标签 [noweb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
90 浏览

emacs - 忽略 html 导出中的 noweb 语法

我有一个组织文档,其中包含:

而且我想实际上忽略<<refresh>>它,以便在我导出 HTML 时正确导出为实际文本<<refresh>>(这是一篇演示 org-babel 和 noweb 的文章)。相反,它导出为空白,我怎样才能让它逐字导出?

0 投票
1 回答
166 浏览

r - missing chunk names in knitr tangled R code

When using Stangle on a Sweave document, the output includes a comment that gives the chunk name. This is incredibly useful in a teaching setting to orient students in the code as they cut-and-paste. However, when I use knitr to generate the .R code from a .Rnw, the chunk names are not included (at least that I can see):

I could run Stangle on a document written for knitr except that there are incompatibilities in chunk arguments that preclude running Stangle without errors.

Is there a way to force knitr to produce comments in tangled R code that include chunk names (and/or numbers) like native Stangle?

0 投票
1 回答
605 浏览

emacs - 有什么方法可以使 org-babel 正确缩进 noweb 纠结的代码?

纠结这个:

产生这个:

我打开了org-src-preserve-indentation,但它无法保留不存在的内容。如果代码编辑窗口看不到前面源代码块中的部分,则无法正确设置。最后,我不想在每次开始一个新的源代码块时都通过所有之前的代码片段来确定缩进应该从什么开始。

当前的技巧是纠结源代码,在新缓冲区中打开纠结的文件,全选并运行c-indent-line-or-region,但我希望有比这更好的东西。

组织模式版本:8.2.5h

0 投票
1 回答
1053 浏览

emacs - Emacs org 模式:如何使用 noweb 语法创建识字程序

我正在尝试创建这个 Perl 程序:

我创建了这个组织文件:

但它创造了这个:

问题:

  1. 文件顶部有一个空行。
  2. Noweb 块没有展开,而是放在文件的底部。
  3. 我不明白,如何在顶部写一次输出文件名?目前,我必须为每个块重写它::tangle test.pl.
0 投票
1 回答
37 浏览

noweb - noweb 输出中不需要的问号

我有以下 noweb 文件,标题为test

我键入以下命令:

pdf 看起来像这样:

这些问号是什么,我该如何摆脱它们?

0 投票
0 回答
96 浏览

python - 使用文学编程时如何处理相同的方法名称?

我想用一个识字的编程工具来写一个python程序。我选择的工具是 noweb。我的IDE是emacs。

我遇到的问题是我有具有相同方法名称的类。例如,python 程序将 Web 服务客户端实现到多个 Web 服务服务器,每个 Web 服务服务器都有一个搜索服务。乍一看,我将其编码如下:

编织 this 的结果表明 search 被定义了两次,无法看到代码中的wsca.search()哪个地方被调用,又被调用到了哪里wscb.search()

为了解决这个问题,我能想到的一个选择是为方法提供唯一的名称,但我不认为这是一个可接受的解决方案。

有没有人可以解决这个问题?

0 投票
1 回答
237 浏览

emacs - Org-Mode:从 noweb 插入调用 noweb 插入

a 和 b - python 函数,c - 简单的 noweb 插入到 python 源代码块,以及 d - noweb 插入到与 noweb 插入一起运行。函数 c -- 正在工作,但函数 d -- 没有,因为 python 尝试执行插入,但这是无效的语法。是否可以从 noweb 插入运行 noweb 插入?

0 投票
1 回答
929 浏览

emacs - 用于 Markdown 和 Python 的 Emacs 多模式

我使用 python3 pweave库 ( http://mpatell.com/pweave/usage.html ) 进行识字编程

pweave 使用作为文本模式markdown,作为代码模式python3,并且可以使用noweb ( https://en.wikipedia.org/wiki/Noweb ) 识字编程语法。

为了在emacs中正确突出显示语法,我打算使用polymode库(https://polymode.github.io/https://github.com/polymode)。

我使用emacs version26.1。而且我能够从 melpa 安装 polymode。

不幸的是,主机模式没有预先存在的多模式:markdown,内部模式:python3,语法:noweb 所以我尝试根据文档和现有代码编写我的一个 poly-pweave-mode,方法是:lisp代码到我的.emacs文件中。

但不知何故,emacs 不吃这个。当我打开 emacs 时,出现以下错误:

我错了什么?我怎样才能让所需的多模运行?

0 投票
0 回答
31 浏览

noweb - noweb html 输出中出现不需要的星号

在给定以下文件运行时,我的 noweb html 输出中的每个文档部分之前都出现了星号(甚至html doctype 之前!) :noweave -html -index -n hello.nw > hello.htmhello.nw

这是输出(注意出现在文档类型之前的星号!?):

这仅在打开索引时发生,也仅在我使用 html 标记启动 doc 部分时发生。在此处的 wc 示例( https://www.cs.tufts.edu/~nr/noweb/examples/wc.nw.html )上运行相同的命令时,它似乎根本没有发生,但我不能弄清楚我做错了什么。

0 投票
1 回答
136 浏览

noweb - 在 Windows 10 上安装 noweb 的安全、简单的方法是什么?

显然只有一个人设法做到了。我正在逐步精确地跟踪他的安装,但我没有 iconc 编译器。按照 Makefile 的说明,我正在使用 icont(我确实有),但是 Jim 的说明根本不起作用。

这里的问题是icont创建totex.icx而不是totex. 这是因为我没有iconc并且正在使用icont吗?我从它的主页安装了 icont,但它似乎没有附带iconc. 我应该怎么办?

只是让你知道:我已经改变了lib/Makefile调用这些程序totex.icx,所以我能够构建整个东西,但是 noweave 那时不起作用,所以我从头开始做了这一切并停止到上面的这一点在这里问这个问题是因为我与 Jim 唯一不同的是他可能拥有iconc编译器而我没有。(他显然也在 Windows 7 上,但我认为这根本没有任何区别。)谢谢!