File: pud-base.7

package info (click to toggle)
zoem 08-248-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,752 kB
  • ctags: 2,074
  • sloc: ansic: 17,928; sh: 789; makefile: 228
file content (568 lines) | stat: -rw-r--r-- 13,543 bytes parent folder | download
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
.\" Copyright (c) 2008 Stijn van Dongen
.TH "pud-base" 7 "4 Sep 2008" "pud-base 1\&.002, 08-248" "MISCELLANEOUS "
.po 2m
.de ZI
.\" Zoem Indent/Itemize macro I.
.br
'in +\\$1
.nr xa 0
.nr xa -\\$1
.nr xb \\$1
.nr xb -\\w'\\$2'
\h'|\\n(xau'\\$2\h'\\n(xbu'\\
..
.de ZJ
.br
.\" Zoem Indent/Itemize macro II.
'in +\\$1
'in +\\$2
.nr xa 0
.nr xa -\\$2
.nr xa -\\w'\\$3'
.nr xb \\$2
\h'|\\n(xau'\\$3\h'\\n(xbu'\\
..
.if n .ll -2m
.am SH
.ie n .in 4m
.el .in 8m
..
.SH NAME
pud-base \- a description of the Portable Unix Documentation base language

The macros in this package have been ported to both HTML and
troff\&.
.SH DESCRIPTION

\fIpud-base\fP \- A description of the Portable Unix Documentation (PUD)
base language\&. The macros in this package have been ported to both
HTML and troff\&.
This package is used by the PUD mini-language for
authoring manual pages (\fBpud-man\fP) and the PUD language
for FAQ authoring (\fBpud-faq\fP)\&.

There is a small list of known issues in the \fBISSUES\fP section,
mostly concerning the troff device\&. These should generally be of no
concern at all, but if you run into trouble look there first\&. A quick
glance through the list \fIbefore\fP you run into trouble may be the
wisest thing to do\&.
.SH INTRODUCTION TO THE ITEMIZE ENVIRONMENT

The \fIitemize\fP environemnt is the PUD workhorse for lists,
enumerations, itemizations, and other tailed creatures\&. A simple and
valid use is for example

.di ZV
.in 0
.nf \fC
  \ebegin{itemize}
      \eitem{\ebf{foo}}
         For I am foo\&.
      \eitems{
         {\ebf{barra}}
         {\ebf{zuttelezut}}
      }
         For we are bar and zut\&.
   \eend{itemize}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR

This source result in the following output:

.ZI 3m "\fBfoo\fP"
\&
.br
For I am foo\&.
.in -3m

.ZI 3m "\fBbarra\fP"
\&
'in -3m
.ZI 3m "\fBzuttelezut\fP"
\&
'in -3m
'in +3m
\&
.br
For we are bar and zut\&.
.in -3m

This is not impressive at all, but it gives an idea of how itemize works\&.
The following example is a single itemize environment providing a
rollercoasterride through most of the features of the itemize environment\&.
As shown below, it is possible to change all the itemize settings and styles
at will even within a single itemize instance\&. Of course this is not useful
at all except for demonstrating the \fIitemize\fP capabilities, but it goes
to show that the itemize macros are quite robust (by virtue of modularity)\&.

\fBNOTE\fP
.br
The entire listing below was put in PUD\&'s \fIspacing\fP environment,
described further below\&. The environment was used to create
extra margins on the two sides\&.
\&.
.in +1m
.ll -3m

.ZJ 5m 3m "1"
Several spacing modes (contiguous, compact, indent)\&. The mode in the
current list is both compact and contiguous\&. Compact means that the itemize
token and the ensuing text are on the same line\&. Contiguous means that there
is no paragraph skip between different item-description pairs\&. Below,
compact mode is switched off (approximately) halfway\&.
.in -8m
.ZJ 5m 3m "2"
Several item modes (custom, mark, enumeration)\&.
.in -8m
.ZJ 5m 3m "3"
Several enumeration modes (roman, arabic, alphabetic)\&.
.in -8m
.ZJ 5m 3m "iv)"
The style of a list can be changed while in the middle of it\&.
.in -8m
.ZJ 5m 3m "v)"
Nuther item\&.
.in -8m
.ZJ 5m 3m "vi)"
The list can be \&'interupted\&' and resumed (by means of
the \fC\eintermezzo#1\fP macro)\&.
.in -8m
Perhaps you wonder what good is THAT for, and justly so\&.
The \fC\eintermezzo#1\fP macro should only be used inbetween different
items, i\&.e\&. it should \fInot\fP split content belonging to a single item\&.
.ZJ 5m 3m "[7]"
Items can be optionally and automatically
right and/or left delimited\&. The current
item is delimited with square brackets\&.
.in -8m
.ZI 8m "[8]"
Items can be left or right aligned\&.
.in -8m
.ZI 8m "[9]"
Items can be stacked, which is supported only when compact is off\&.
.in -8m
.ZI 8m "[10]"
\&
.br
Beginning with this item, compact is off\&.
.in -8m
.ZI 8m "Implying"
\&
'in -8m
.ZI 8m "That"
\&
'in -8m
.ZI 8m "Stacking"
\&
'in -8m
'in +8m
\&
.br
is now possible\&.
.in -8m
.ZJ 5m 3m "[12]"
\&
.br
(back to right-align) The itemcounter just keeps running by the way\&.
.in -8m
.ZJ 5m 3m "[18]"
(back to compact) But the counter can be manipulated at will\&.
.in -8m
.ZJ 5m 3m "\(bu"
A bullet item, with an ugly bullet in HTML\&. Unfortunately the \fC•\fP
entity is not widely supported yet\&. I decided to stick with a plain asterisk
until that time arrives\&.
.in -8m

.ZJ 5m 3m "\(bu"
We now switch to contiguous=0 mode (affecting the current list),
and start a new list that is contiguous to the present text
(by setting margintop to 0)\&.
.ZJ 4m 2m "a\&."
Hubris
.in -6m
.ZJ 4m 2m "b\&."
Laziness
.in -6m
.ZJ 4m 2m "c\&."
Impatience
.in -6m
Are the three virtues of programming\&.
.in -8m

.ZJ 5m 3m "\(bu"
This concludes a listing showing most of the itemize capabilities\&.
.in -8m
.in -1m
.ll +3m
.SH USING THE ITEMIZE ENVIRONMENT

You steer the itemize environment by providing it with tag-value pairs like
so:

.di ZV
.in 0
.nf \fC
   \ebegin{itemize}{
      {compact}{1}
      {contiguous}{1}
      {align}{right}
      {type}{abc}
      {rp}{\&.}
   }
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR

This is the list of tags that you may use\&.

.ZI 3m "\fImargintop\fP"
\&
.br
Top of table, anomalous unit (ems), default 0\&.
.in -3m

.ZI 3m "\fIcontiguous\fP"
\&
.br
Don\&'t put paragraph skips inbetween items, default 0 (do it)\&.
.in -3m

.ZI 3m "\fIcompact\fP"
\&
.br
Put item and description on same line, default 0 (don\&'t do it)\&.
.in -3m

.ZI 3m "\fIw1\fP"
\&
.br
Width of item column in ems\&.
.in -3m

.ZI 3m "\fIw2\fP"
\&
.br
Width of separating column in ems\&.
.in -3m

.ZI 3m "\fImark\fP"
\&
.br
E\&.g\&. \(bu (if type=mark), affects \fC\eitem\fP\&.
.in -3m

.ZI 3m "\fIalign\fP"
\&
.br
One of left or right (item alignment), default left\&.
.in -3m

.ZI 3m "\fIdebug\fP"
\&
.br
Shows underlying table structure in html\&.
.in -3m

.ZI 3m "\fIlp\fP"
\&
.br
What\&'s printed immediately to the left of an item\&.
.in -3m

.ZI 3m "\fIrp\fP"
\&
.br
What\&'s printed immediately to the right of an item\&.
.in -3m

.ZI 3m "\fItype\fP"
\&
.br
One of mark, roman, abc, arabic, affects \fC\eitem\fP\&.
.in -3m

.ZI 3m "\fIitemcount\fP"
\&
.br
The count of items seen so far, e\&.g\&. 11 right now\&.
.in -3m

You need to know that the itemize environment internally maps these tags
to dollar keys simply by prepending a dollar\&.
Thus, if you want to reset one of the values associated with such a tag,
you need to do e\&.g\&.

.di ZV
.in 0
.nf \fC
\eset{$align}{right}
\eset{$itemcount}{30}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR

.SH THE SPACING ENVIRONMENT

Its syntax is identical to that of the \fIitemize\fP environment\&.
It accepts tags \fIleft\fP, \fIright\fP, \fItop\fP, and \fIbottom\fP\&.
These should receive numeric values\&. The associated
unit is millimeter\&.

The troff device does not yet support the \fItop\fP and \fIbottom\fP
tags\&.
.SH MACROS

.ZI 3m "\e\fBenref#2\fP"
\&
'in -3m
.ZI 3m "\e\fBiref#2\fP"
\&
'in -3m
.ZI 3m "\e\fBlref#2\fP"
\&
'in -3m
.ZI 3m "\e\fBaref#2\fP"
\&
'in -3m
.ZI 3m "\e\fBhttpref#1\fP"
\&
'in -3m
.ZI 3m "\e\fBsibref#1\fP"
\&
'in -3m
.ZI 3m "\e\fBsibref#2\fP"
\&
'in -3m
.ZI 3m "\e\fBsibref#3\fP"
\&
'in -3m
'in +3m
\&
.br
\fC\eenref#2\fP \fIcreates\fP a link for which the first argument is the anchor
and for which the second argument is the content (which can be left empty)\&.
\fC\eiref#2\fP takes such an anchor as the first argument and it takes content
that carries the link as the second argument\&. \fC\elref#2\fP takes a file name
(possibly including a relative or absolute path) as the first argument and
content as the second argument\&. \fC\earef#2\fP takes a URL (later possibly a
URI) as the first argument and content as the second argument\&. \fC\esibref#2\fP
takes a label as argument which presumably is the name of some application\&.
It may append an extension depending on the current device, and it assumes
that \fClabel + extension\fP is the name of a file in the current directory\&.
The second argument is displayed in the text\&. For \fC\esibref#1\fP the
displayed text is the same as the label\&. For \fC\esibref#3\fP the second
argument is an additional anchor within the file being linked to, and
the third argument is the displayed text\&.
\fC\ehttpref#1\fP simply prints a URL which will be active when html is output\&.
.in -3m

.ZI 3m "\e\fBpar#1\fP"
\&
'in -3m
.ZI 3m "\e\fBcpar#2\fP"
\&
'in -3m
.ZI 3m "\e\fBcar#1\fP"
\&
'in -3m
.ZI 3m "\e\fBccar#2\fP"
\&
'in -3m
'in +3m
\&
.br
These are all paragraph macros that carry the paragraph content as
the last argument\&. The first argument of \fC\ecpar#2\fP and \fC\eccar#2\fP
is the caption\&. These macros will ensure wellformedness for devices
that support it, such as HTML\&. For more information on the differences
between these macros consult the entries below\&.
.in -3m

.ZI 3m "\e\fBpar\fP"
\&
'in -3m
.ZI 3m "\e\fBcpar#1\fP"
\&
'in -3m
.ZI 3m "\e\fBcar\fP"
\&
'in -3m
.ZI 3m "\e\fBccar#1\fP"
\&
'in -3m
'in +3m
\&
.br
use \fC\ecar\fP where you don\&'t need a paragraph skip, but just need to
indicate that you are in text mode again\&. You can simply always use
\fC\epar\fP and never use \fC\ecar\fP\&. If you care about the details of spacing
though, or if you have particular trouble for example in creating an itemize
environment where you do not want top and bottom margins, then it could be
worthwile to turn to \fC\ecar\fP under very specific circumstances\&. Examples
for using \fC\ecar\fP are:
.ZJ 2m 1m "\-"
After an environment that always carries a bottom margin\&.
.in -3m
.ZJ 2m 1m "\-"
After a caption that always carries a bottom margin, such
as most sectioning commands (e\&.g\&. \fC\esec\fP in the manual macros)\&.
.in -3m
.ZJ 2m 1m "\-"
After an environment that does \fInot\fP carry a bottom margin,
and where you specifically want the environment to be contiguous to the
enclosing text\&. The listing you are currently reading is an
example of this\&.
.in -3m
As promised\&. The \fC\ecar\fP macro may feel a little unusual\&. If you don\&'t mind
standing the chance of a little spurious vertical white-space just use
\fC\epar\fP all the time\&. If you really need it, such as in an \&'inline\&' listing
as above, the \fC\ecar\fP macro is ready to do the job\&.
.in -3m

.ZI 3m "\e\fBbf#1\fP"
\&
'in -3m
.ZI 3m "\e\fBit#1\fP"
\&
'in -3m
.ZI 3m "\e\fBtt#1\fP"
\&
'in -3m
.ZI 3m "\e\fBv#1\fP"
\&
'in -3m
.ZI 3m "\e\fBftinc#2\fP"
\&
'in -3m
.ZI 3m "\e\fBftdec#2\fP"
\&
'in -3m
'in +3m
\&
.br
The first four items set their argument in the \fBfont\fP \fIspecified\fP\&.
\fC\ett#1\fP and \fC\ev#1\fP both denote a typewriter font\&. \fIThese macros should
not be nested if troff is to be among the output devices\fP\&. Support for the
last two items is not yet very robust\&. They temporarily increment
respectively decrement the font by the amount of the first argument and
apply the resulting setting to the second argument\&.
.in -3m

.ZI 3m "\e\fBverbatim#1\fP"
\&
'in -3m
.ZI 3m "\e\fBverbatix#1\fP"
\&
'in -3m
'in +3m
\&
.br
Make the device output the contents verbatim in a mono-spaced font,
obeying spaces and newlines\&. This does not prohibit expansion of zoem
macros, use \fC\eprotect#1\fP for that\&. The macro \fC\everbatim#1\fP will
create a non-breaking environment\&.
.in -3m

.ZI 3m "\fB\e""html::charset""\fP"
\&
.br
Set this e\&.g\&. to ISO-8859-5 or some other acceptable charset label\&.
Do this \fIbefore\fP you use the \fCpreamble\fP key from the base package
that you are using (e\&.g\&. the \fCman\&.zmm\fP or \fCfaq\&.zmm\fP macros)\&.
.in -3m
.SH ISSUES

.ZI 3m "\fBNesting\fP"
\&
.br
Do not nest \fC\ebf#1\fP, \fC\eit#1\fP, \fC\ett#1\fP, or \fC\ev#1\fP macros if troff is
among the output devices\&. It will yield unexpected results\&.
.in -3m

The rest of this list pertains to the \fIitemize\fP environment\&.

.ZI 3m "\fBBoldness\fP"
\&
.br
There is currently not a way to get bold (Roman) numerals using
the automatic enumeration mode within \fIitemize\fP, or to change
the appearance of any of the other enumeration types\&.
.in -3m

.ZI 3m "\fBMargins\fP"
\&
.br
If you use fractional values for \fCw1\fP and \fCw2\fP in the itemize
environment, you may well run into a problem with troff (c\&.q\&. nroff)
Suppose you use \fCw1=1\&.6\fP and \fCw2=0\&.8\fP\&. Nroff will round both these
values as well as the sum of the two, thus incrementing by \fC2\fP and \fC1\fP,
followed by a decrement of \fC2\fP\&.
.in -3m

.ZI 3m "\fBMisc\fP"
\&
.br
Refrain from doing

.di ZV
.in 0
.nf \fC
   \ebegin{itemize}
   \ebegin{spacing}
   \eitem{foo}
   FOO
   \eitem{bar}
   BAR
   \eend{spacing}
   \eend{itemize}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR

Because the \fC\eitem#1\fP invocations will update keys in the dictionary
pushed by the \fIspacing\fP environment rather than the dictionary beneath
it that was pushed by the \fIitemize\fP environment\&.
On the other hand, you \fIcan\fP do this:

.di ZV
.in 0
.nf \fC
   \ebegin{spacing}
   \ebegin{itemize}
   \eitem{foo}
   FOO
   \eitem{bar}
   BAR
   \eend{itemize}
   \eend{spacing}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR

The reason being that the \fIspacing\fP environment does not facilitate
associated keys within the dictionary scope it creates\&.
Compare with this with the \fIitemize\fP environment, that facilitates
the use of \fC\eitem#1\fP, \fC\eitem\fP, and \fC\eitems#1\fP\&.
.in -3m