summaryrefslogtreecommitdiff
path: root/systems/knuth/local/man1/weave.1
blob: 487c354b444f5df703717a134035746354554553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.TH WEB 1L 10/19/89
.SH NAME
tangle, weave \- translate WEB to Pascal and/or TeX
.SH SYNOPSIS
.B tangle
webfile[.web] [changefile[.ch]]
.br
.B weave
[
.B \-x
] webfile[.web] [changefile[.ch]]

.SH DESCRIPTION
The
.I tangle
program converts a WEB
source document into a Pascal program that may be compiled in the usual
way with the on-line Pascal compiler (e.g.,
.IR pc (1)).
The output file is all in lower case
and packed into lines of 72 characters or less, with the only concession
to readability being the termination of lines at semicolons when this can
be done conveniently.
.PP
WEB is a new language that Don Knuth has created, which
allows you to prepare a single
document containing all the information that is needed both to produce
a compilable Pascal program and to produce a well-formatted document
describing the program in as much detail as the writer may desire.  The
user of WEB must be familiar with both TeX and Pascal.
.PP
WEB provides a relatively simple, although adequate, macro facility that
permits a Pascal program to be written in small easily-understood modules.
The
.I tangle
program assembles these modules into a usable Pascal program.
.PP
The command line should have either one or two names on it.
The first is taken as the WEB file (and .web is added if there is no
extension).
If there is another name, it is a change file (and .ch is added if there is
no extension).  The change file overrides parts of the WEB file,
as described in the documentation.
.PP
The output files are a Pascal file and a string pool file,
whose names are formed by adding .p and .pool respectively to the
root of the WEB file name.
.PP
The 
.I weave
program is used to create a TeX file for viewing the WEB program.
It takes appropriate care of typographic details like page
layout and the use of indentation, italics, boldface, etc.,and it supplies
extensive cross-index information that it gathers automatically.
The command line arguments are the same as for
.I tangle
except for the options. The
.B \-x
option says to omit the index, module name list, and table of contents pages.
(A CONTENTS.tex file will still be written, however, unless some default
macros are redefined.)
.PP
The output TeX file name is formed by using .tex as the extension of the
WEB file name.
.PP
There are several macros in webmac.tex that probably should be redefined by
the user at the beginning of the WEB file.
It is a good idea to set \\title
to the name of the program.
And, to cause output of only changed modules, one can say
\\let\\maybe=\\iffalse (usually as the first change in the
change file).
.PP
.SH FILES

/home/tex/dist/lib/webmac.tex   TeX macros used by weave output.
.SH "SEE ALSO"
.I The WEB System of Structured Documentation
and
.br
.I Literate Programming
by D.E. Knuth.
.br
.I Weaving a Program
by Wayne Sewell
.br
tex(1), pc(1)
.br
pxp(1) (for formatting tangle output when debugging)
.br
pooltype(1) (for symbolic listing of the pool file)
.br
.I TeX: The Program
.br
.I METAFONT: The Program
are by far the largest extant examples of WEB programs.
.br
.SH "AUTHORS"
WEB was designed by Donald E. Knuth, based on an earlier system
called DOC (implemented by Ignacio Zabala).
The
.I tangle
and
.I weave
programs are themselves written in WEB. The system
was ported to Unix at Stanford by Howard Trickey, and at Cornell by Pavel
Curtis.  This version combines their work.