1

I'm getting asterisks appearing before each documentation section in my noweb html output (even before the html doctype!) when running noweave -html -index -n hello.nw > hello.htm given the following hello.nw file:

<!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>

Here's the output (note the asterisk appearing before the 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>

This only happens when indexing is turned on, also it happens only when I start the doc section with a html tag. It doesn't seem to happen at all when running the same command on the wc example here (https://www.cs.tufts.edu/~nr/noweb/examples/wc.nw.html) but I can't figure out what I'm doing wrong.

Luka Aleksić
  • 347
  • 2
  • 10

0 Answers0