summaryrefslogtreecommitdiff
path: root/tmac/www.tmac
blob: 0f1bdd7b3ef4e3063afc9cdee438f0d3238619bf (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
.\" www.tmac
.\"
.\" A simple set of macros to provide HTML documents with basic
.\" www functionality.  It should work with any macro set.
.\"
.nr _C \n(.C
.cp 0
.
.nr www-html 0
.if '\*[.T]'html' .nr www-html 1
.
.if r ps4html \{\
.  \" remove the title command when we are generating images for html
.  \" (stops a title accidentally appearing inside an image)
.  tl ````
.  rm tl
.  de tl
.  .
.\}
.
.\"
.\" the main auxiliary macro for the HTML interface
.\"
.de HTML
.  if \n[www-html] \{\
.    \" the following line makes the vertical mode leave, so to say
.    nop \&
.    nop \X^html:\\$*^
.  \}
..
.\"
.\"
.\"
.de HTMLINDEX
.  if \n[www-html] \
.    nop \X^index:\\$*^
..
.\"
.\"  BODYCOLOR - $1 is foreground color
.\"              $2 is background color
.\"              $3 is the color of an active hypertext link
.\"              $4 is the color of a hypertext link not yet visited
.\"              $5 is the color of a visited hypertext link
.\"
.de BODYCOLOR
.  HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
..
.\"
.\" BACKGROUND - $1 is the background image file
.\"
.de BACKGROUND
.  HTML <body background=\\$1>
..
.\"
.\"  URL - $1 is the classical underlined blue text
.\"        $2 is the url
.\"        $3 is optional stuff printed immediately after $3
.\"
.de URL
.  ie \n[www-html] \
.    HTML <a href="\\$2">\\$1</a>\\$3
.  el \
.    nop \m[blue]\\$1\mP \%\[la]\fC\\$2\fP\[ra]\\$3
..
.\"
.\"  FTP - $1 is the classical underlined blue text
.\"        $2 is the ftp url
.\"        $3 is optional stuff printed immediately after $2
.\"
.de FTP
.  ie \n[www-html] \
.    HTML <a href=\\$2>\\$1</a>\\$3
.  el \
.    nop \m[blue]\\$1\mP \%\[la]\fC\\$2\fP\[ra]\\$3
..
.\"
.\" MAILTO - generate html email reference
.\"          $1 is the email address (without the `mailto:' prefix)
.\"          $2 is the optional name
.\"          $3 is optional stuff printed immediately after $2 (resp. $1)
.\"
.\"          example:
.\"
.\"            Foobar has been written by
.\"            .MAILTO fred@foo.bar "Fredrick Bloggs" .
.\"
.de MAILTO
.\"
.\" force reset after a potential heading by performing some motion..
.\" how do we do this --fixme--
.\"  \h'\w' ''\h'-\w' '' doesn't work..
.  ie \n[www-html] \{\
.    ie '\\$2'' \
.      HTML "<a href=mailto:\\$1>\\$1</a>\\$3"
.    el \
.      HTML "<a href=mailto:\\$1>\\$2</a>\\$3"
.  \}
.  el \{\
.    ie '\\$2'' \
.      nop \m[blue]\fC\\$1\fP\mP\\$3
.    el \
.      nop \m[blue]\\$2\mP \%\[la]\fC\\$1\fP\[ra]\\$3
.  \}
..
.\"
.\" TAG - generate an html name $1
.\"
.de TAG
.  HTML <a name="\\$1"></a>
..
.\"
.\" IMAGE - reference an image
.\"         $1 is the image file
.\"         $2 is the alignment r, l or c (centered by default)
.\"         $3 is the x width (default if absent is 400 pixels)
.\"         $4 is the y width (default if absent is the x value)
.\"
.de IMAGE
.  ie \n[www-html] \{\
.    ie '\\$2'r' \
.      HTML-TAG ".right-image"
.    el \{\
.      ie '\\$2'l' \
.        HTML-TAG ".left-image"
.      el \
.        HTML-TAG ".centered-image"
.    \}
.    nr www-width 400
.    if !'\\$3'' \
.      nr www-width \\$3
.    nr www-height \\n[www-width]
.    if !'\\$4'' \
.      nr www-height \\$4
.    HTML <img src="\\$1" width=\\n[www-width] height=\\n[www-height]>
.  \}
.  el \{\
.    B1
.    nop \[la]\fC\\$1\fP\[ra]
.    B2
.  \}
..
.\"
.\" HTML-TAG - emit a tag for the grohtml
.\"
.de HTML-TAG
.  if \n[www-html] \{\
.    \" the following line makes the vertical mode leave, so to say
.    nop \&
.    nop \X^html-tag:\\$*^
.  \}
..
.\"
.\" LINKS - emit the automatically collected links derived from
.\"         section/numbered headings at this position.
.\"
.de LINKS
.  HTML-TAG ".links"
..
.\"
.\" LINE - produce a horizontal line
.\"
.de LINE
.  ti 0
.  HTML <hr>
..
.\"
.\"  NO-AUTO-RULE - suppresses the generation of the top and bottom rules
.\"                 which grohtml emits by default.
.\"
.de NO-AUTO-RULE
.  HTML-TAG ".no-auto-rule"
..
.\"
.\"  www-end-nowhere - end of input trap called to finish diversion.
.\"
.de www-end-nowhere
.  di
..
.\"
.\"  HTML-TL - generate a HTML title only
.\"            which differs from the -ms .TL which generates
.\"            both a HTML title and a H1 heading.
.\"            This is useful when an author wishes to use a HTML title
.\"            as search engine fodder but use a graphic in the document.
.\"
.de HTML-TL
.  HTML-TAG ".html-tl"
.  if !\n[www-html] \{\
.    di www-nowhere
.    it 2 www-end-nowhere
.  \}
..
.
.ds www-level1 \[bu]\ \ \"
.ds www-level2 \[sq]\ \ \"
.ds www-level3 \[ci]\ \ \"
.nr www-level 0
.
.\"
.\" auxiliary macro for UL-BEGIN
.\"
.de www-push-level
.  nr www-level +1
.  if (\\n[www-level] > 3) \
.    @error "too many levels of indentation (\\n[www-level])"
..
.\"
.\" auxiliary macro for UL-END
.\"
.de www-pop-level
.  if !\\n[www-level] \
.    @error "trying to terminate a list which does not exist"
.  nr www-level -1
.  HTML "</ul>"
..
.\"
.\" start an unordered list
.\"
.de UL-BEGIN
.  www-push-level
.  ie \n[www-html] \
.    HTML "<ul>"
.  el \{\
.    br
.    in +\w'\\*[www-level\\n[www-level]]'
.  \}
..
.\"
.\" end an unordered list
.\"
.de UL-END
.  ie \n[www-html] \
.    HTML "</ul>"
.  el \{\
.    br
.    in -\w'\\*[www-level\\n[www-level]]'
.  \}
.  www-pop-level
..
.\"
.\" insert a list item
.\"
.de LI
.  ie \n[www-html] \
.    HTML "<li>"
.  el \{\
.    br
.    ti -\w'\\*[www-level\\n[www-level]]'
.    nop \\*[www-level\\n[www-level]]\c
.  \}
..
.\"
.\" supplementary macros used by other macro sets
.\"
.\" here are some tags specially for -Tps or -Thtml when invoked by pre-html
.\" to generate png images from postscript.
.\"
.\" www-do-image - tells troff to issue an image marker which can be
.\"                read back by pre-html
.\"
.de www-do-image
.  if r ps4html \
.    nop \O[3]\O[5\\$2\\$1.png]\O[0]\O[1]
.  if \n[www-html] \
.    nop \O[3]\O[5\\$2\\$1.png]\O[0]
..
.\"
.\" HTML-IMAGE-END - terminates an image for html
.\"
.de HTML-IMAGE-END
.  if r ps4html \
.    nop \O[2]\O[1]\O[4]
.  if \n[www-html] \
.    nop \O[2]\O[1]\O[4]
..
.
.nr www-png-no 0
.
.\"
.\" www-make-unique-name - generates another unique name in string
.\"                        `www-unique-name'
.\"
.de www-make-unique-name
.  nr www-png-no +1
.  ds www-unique-name \\n[.F]-auto-\\n[www-png-no]\"
..
.\"
.\" HTML-IMAGE - is the same name as a tag generated from eqn/tbl/pic.
.\"              Although the tags generated via the preprocessor
.\"              are given image names by pre-html and troff.
.\"              The macros below can only be invoked by *other macro sets*
.\"              not user troff input since the contents of macro sets are
.\"              not seen by pre-html.
.\"
.de HTML-IMAGE
.  \" generates a centered image
.  www-make-unique-name
.  www-do-image \\*[www-unique-name] c
..
.
.de HTML-IMAGE-RIGHT
.  www-make-unique-name
.  www-do-image \\*[www-unique-name] r
..
.
.de HTML-IMAGE-LEFT
.  www-make-unique-name
.  www-do-image \\*[www-unique-name] l
..
.
.de HTML-IMAGE-INLINE
.  www-make-unique-name
.  www-do-image \\*[www-unique-name] i
..
.
.
.if \n[www-html] \{\
.   nh
.   nr HY 0
.\}
.cp \n(_C
.
.\" EOF