NoWeb Literate Syntax

Created: 2022-09-09T00:20:23-05:00

Return to the Index

Input is separated in to "chunks."

Chunks are triggered by special lines.

Documentation Blocks

A line starting with @ changes to a documentation block.

Double square brackets escape a documentation block to represent code. Only the last two closing brackets are consumed such that quoting a[i] is done [[a[i]]].

Code Blocks

Code chunks start a line <<like this>>=

When a code line contains <<text in bracketed pairs>> then that block is considered a reference to another block.

Output files whos names end with an asterisk mean the file should include line numbers.

Prefixing << or >> with @ force the brackets to be escaped.

Output Files

Same as a code block with one exception: if there are no spaces between the brackets then the output is a file. <<some-file.txt>> vs <<description block>>.

Tangle and Weave Filters

Special programs are used to extract documentation and executable files where macros are processed. Parameters may be given to only allow outputs of a single named file (to fit in better with build systems etc.)