The following noweb man page is used by permission of the author, Norman Ramsey.
Noweb is a literate-programming tool like Knuth's WEB, only simpler. A noweb file contains program source code interleaved with documentation.
Body text is a sequence of chunks (also known as sections), which may appear in any order. A chunk may contain code or documentation. Doc chunks begin with a line that starts with an at sign (@) followed by a space or newline. They have no names. Code chunks begin with
<<chunk name>>=
on a line by itself. The double left angle bracket (<<) must be in the first column. Chunks are terminated by the beginning of another chunk, or by end of the body text. If the first line of body text does not mark the beginning of a chunk, it is assumed to be the first line of a documentation chunk.
Doc chunks contain text that is ignored by the Tangle command and copied verbatim to standard output by the Print (Weave) command (except for quoted code).
Code chunks contain program source code and references to other code chunks. Several code chunks may have the same name; the Tangle command concatenates their definitions to produce a single chunk. Code chunk definitions are like macro definitions; The Tangle command extracts a file by expanding the chunk following the @root directive. (See below). The definition of that chunk contains references to other chunks, which are themselves expanded, and so on.
The output of the Tangle command is readable; it preserves the indentation of expanded chunks with respect to the chunks in which they appear.
If double left and right angle brackets are not paired, they are treated as literal << and >>. Users can force any such brackets, even paired brackets, to be treated as literal by using a preceding at sign (e.g. @<<).
Some programming or formatting languages may require a single @ sign in the first column. Noweb users may achieve this effect by putting a doubled @@ in the first column; in this position only, it stands for a single @ sign.
Any line beginning with `@ ' terminates a code chunk, but if the line has the form
@ %def identifiers
it is taken to mean that the preceding chunk defines the identifiers listed in identifiers. This list contains identifiers separated by whitespace; any sequence of non white characters may be an identifier.
Here are some details of how Leo handles noweb:
<< goto done if x < y >> <<GOTO done if x < y>>
Windows versions of Leo prior to version 2.0 are different in from leo.py and Windows version 2.x.
allow @<< instead of << .
The @code directive is an abbreviation for << chunk name >>=, provided that the headline text of the node containing the @code directive starts with a valid chunk name. See below for more details.
Leo does not presently support the <<*>> syntax.