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

时间:2018-10-07 11:53:09

标签: noweb

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Hello noweb</title>
</head>
<body>
<h1>Noweb test</h1>
<p>A noweb hello world.

<<main.c>>=
<<Includes>>
<<Defines>>
<<Main function>>
@

<h2>The main function</h2>
<p>Blablabla...</p>

<<Main function>>=
int main() {
    printf("Hello %s!\n", NAME);
    return MEANING_OF_LIFE;
}
@

<h2>Preprocessor stuff</h2>
<p>Blablabla...</p>

<<Defines>>=
#define NAME "John Doe"
@ %def NAME

<<Includes>>=
#include <stdio.h>
@ %def printf

<<Defines>>=
#define MEANING_OF_LIFE 42
@ %def MEANING_OF_LIFE

<p>Blablabla...</p>

<h2>Chunks</h2>

<nowebchunks>

<h2>Index</h2>

<nowebindex>

</body>
</html>

这是输出(请注意在doctype之前出现星号!?):

<!-- this file was generated automatically by noweave; better not edit it-->
<a name="NWD1">*</a><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Hello noweb</title>
</head>
<body>
<h1>Noweb test</h1>
<p>A noweb hello world.

<pre><a name="NWiMOLW-1ezWyf-1" href="#NWD1"><dfn>&lt;main.c&gt;=</dfn></a></pre><blockquote>This code is written to a file (or else not used).<p>
<a name="NWiMOLW-1ezWyf-1-u1" href="#NWD4"><i>&lt;Includes&gt;</i></a>
<a name="NWiMOLW-1ezWyf-1-u2" href="#NWD3"><i>&lt;Defines&gt;</i></a>
<a name="NWiMOLW-1ezWyf-1-u3" href="#NWD2"><i>&lt;Main function&gt;</i></a>
</blockquote><p>

<a name="NWD2">*</a><h2>The main function</h2>
<p>Blablabla...</p>

<pre><a name="NWiMOLW-32ejEQ-1" href="#NWD2"><dfn>&lt;Main function&gt;=</dfn></a>
int main() {
        <a href="#NWD4">printf</a>(&quot;Hello %s!\n&quot;, <a href="#NWD3">NAME</a>);
        return <a href="#NWD5">MEANING_OF_LIFE</a>;
}
</pre><blockquote>Used <a href="#NWD1">above</a>.<p>
</blockquote><p>

<a name="NWD3">*</a><h2>Preprocessor stuff</h2>
<p>Blablabla...</p>

<pre><a name="NWiMOLW-1K8SOW-1" href="#NWD3"><dfn>&lt;Defines&gt;=</dfn></a>
#define <a href="#NWD3">NAME</a> &quot;John Doe&quot;
</pre><blockquote>Defines <a href="#NWI-NAME"><code>NAME</code></a> (links are to index).<p>
Used <a href="#NWD1">above</a>; <a href="#NWD5">next</a> definition.<p>
</blockquote><p>
<a name="NWD4">*</a>
<pre><a name="NWiMOLW-ZKEBO-1" href="#NWD4"><dfn>&lt;Includes&gt;=</dfn></a>
#include &lt;stdio.h&gt;
</pre><blockquote>Defines <a href="#NWI-printf"><code>printf</code></a> (links are to index).<p>
Used <a href="#NWD1">above</a>.<p>
</blockquote><p>
<a name="NWD5">*</a>
<pre><a name="NWiMOLW-1K8SOW-2" href="#NWD3"><dfn>&lt;Defines&gt;+=</dfn></a>
#define <a href="#NWD5">MEANING_OF_LIFE</a> 42
</pre><blockquote>Defines <a href="#NWI-MEANING_OF_LIFE"><code>MEANING_OF_LIFE</code></a> (links are to index).<p>
Used <a href="#NWD1">above</a>; <a href="#NWD3">previous</a> definition.<p>
</blockquote><p>
<p>Blablabla...</p>

<h2>Chunks</h2>

<ul>
<li><a href="#NWD3"><i>&lt;Defines&gt;</i></a>: <a href="#NWD1">U1</a>, <a href="#NWD3">D2</a>, <a href="#NWD5">D3</a>
<li><a href="#NWD4"><i>&lt;Includes&gt;</i></a>: <a href="#NWD1">U1</a>, <a href="#NWD4">D2</a>
<li><a href="#NWD2"><i>&lt;Main function&gt;</i></a>: <a href="#NWD1">U1</a>, <a href="#NWD2">D2</a>
<li><a href="#NWD1"><i>&lt;main.c&gt;</i></a>: <a href="#NWD1">D1</a>
</ul>


<a name="NWD6">*</a><h2>Index</h2>

<ul>
<li><a name="NWI-MEANING_OF_LIFE" href="#NWD5">MEANING_OF_LIFE</a>: <a href="#NWD2">U1</a>, <a href="#NWD5">U2</a>, <a href="#NWD5">D3</a>
<li><a name="NWI-NAME" href="#NWD3">NAME</a>: <a href="#NWD2">U1</a>, <a href="#NWD3">U2</a>, <a href="#NWD3">D3</a>
<li><a name="NWI-printf" href="#NWD4">printf</a>: <a href="#NWD2">U1</a>, <a href="#NWD4">D2</a>
</ul>


</body>
</html>

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

0 个答案:

没有答案