Artifact Content
Not logged in

Artifact ff9d05627c10126a6494d384458cd81880ff21bd:

Wiki page [asciidoc literate programming] by andrewm 2013-07-07 22:32:14.
D 2013-07-07T22:32:14.178
L asciidoc\sliterate\sprogramming
P b7de158dd84bd5c7f883fe188a235fd017acbb76
U andrewm
W 1289
[http://www.methods.co.nz/asciidoc | Asciidoc] is a plain text markup tool that can produce a
wide variety of outputs.
It is also very suitable for use in a literate programming environment.
The <b>atangle</b> and <b>aweave</b> programs are literate programming tools for use with asciidoc.
What is different about using asciidoc as a literate programming base, is that the source
is a valid asciidoc document and can be formatted on it own.
<b>Atangle</b> is used to extract source code from the document.
<b>Aweave</b> adds some annotation and indexing information to the orignal
asciidoc source.
The use of <b>aweave</b> is optional but adds many index entries and hyperlinks
within the document.
Both <b>atangle</b> and <b>aweave</b> use <b>noweb</b> style chunk definitions.
The [/doc/trunk/aweb/doc/atangle.html|documention] describes the format.
The only key point to remember is that source code in asciidoc is contained
between lines of four or more hyphens.
<pre>
------
A source code block.
------
</pre>
Chunk definitions must be located within source code blocks.
<pre>
------
<<search>>=
// Defines the "search" chunk.
<<found>>
// References the "found" chunk.
------
</pre>
The programs can be obtained from the [Aweb Downloads|downloads] page.
Z 975863ea6c7438724dc672fa9bf0b3e6