Annotation of src/share/tmac/doc2html, Revision 1.18
1.18 ! kleink 1: .\" $NetBSD: doc2html,v 1.17 2000/05/14 14:13:53 veego Exp $
1.1 ross 2: .\"
3: .\" Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
4: .\" All rights reserved.
5: .\"
6: .\" This code is derived from software contributed to The NetBSD Foundation
7: .\" by Ross Harvey.
8: .\"
9: .\" Redistribution and use in source and binary forms, with or without
10: .\" modification, are permitted provided that the following conditions
11: .\" are met:
12: .\" 1. Redistributions of source code must retain the above copyright
13: .\" notice, this list of conditions and the following disclaimer.
14: .\" 2. Redistributions in binary form must reproduce the above copyright
15: .\" notice, this list of conditions and the following disclaimer in the
16: .\" documentation and/or other materials provided with the distribution.
17: .\" 3. All advertising materials mentioning features or use of this software
18: .\" must display the following acknowledgement:
19: .\" This product includes software developed by the NetBSD
20: .\" Foundation, Inc. and its contributors.
21: .\" 4. Neither the name of The NetBSD Foundation nor the names of its
22: .\" contributors may be used to endorse or promote products derived
23: .\" from this software without specific prior written permission.
24: .\"
25: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35: .\" POSSIBILITY OF SUCH DAMAGE.
36: .\"
37: .ig
38:
39: The first section of this package processes a large subset of the -mdoc macro
40: functions into HTML. All of the commonly used requests are implemented.
41:
42: The second section implements -man (-man.old) macros. These are trivial
43: compared to -mdoc.
44:
45: NOTES:
46: The initial purpose of these macros is to support distrib/notes.
47: It's very close, but not quite ready to do all of the man pages.
48:
49: See src/distrib/notes/Makefile.inc for important groff command
50: examples. For HTML generation it is important to turn off overstrike
51: modes with -P-b -P-u -P-o.
52:
53:
54: TODO:
55: There are a few internal macros and other symbols that don't contain
56: an embedded `-'.
57:
58: Need a tbl(1) command that generates html tables from tbl(1)
59: input. (Partially written.) For now, we just switch into <pre>
60: mode on .TS or .PS. Tbl input is very uncommon these days, anyway.
1.10 ross 61: (-mdoc has the .Bl -column list, which eliminates most requirements
1.1 ross 62: for tbl)
63:
64: We should probably end all the html pages with an upward
65: pointing "contents" link, except right now there is nothing
66: to point to.
67:
68: We need "intro" or "contents" pages for each man/man? (man/html?)
69: section.
70:
71: WARNING! If you add a callable macro (or define an old one that
72: was missing) it MUST have a doc2html@@ alias. (Scan for @@ to see.)
73: ..
74: .
75: .de TS
76: <pre>
77: ..
78: .de TE
79: </pre>
80: ..
81: .de PS
82: <pre>
83: ..
84: .de PE
85: </pre>
86: ..
87: .
88: .nr doc-stackp 0
89: .de doc-push
90: . ds doc-stack-rq-\\n[doc-stackp] \\$1
91: . nr doc-stack-ln-\\n[doc-stackp] \\n[.c]
92: . nr doc-stackp +1
93: ..
94: .
95: .de doc-pop
1.10 ross 96: . ie \\n[doc-stackp]<=0 .Error Extraneous \\$1 request
1.1 ross 97: . el .nr doc-stackp -1
98: . ds doc-pop-tmp1 \\*[doc-stack-rq-\\n[doc-stackp]]
99: . if !\\*[doc-pop-tmp1]\\$1 \{\
1.10 ross 100: . tm Need \\*[doc-pop-tmp1] before \\$1
101: . Error See line \\n[doc-stack-ln-\\n[doc-stackp]]
1.1 ross 102: . \}
103: ..
104: .
105: .de doc-rlookup
106: . if !r\\$1 \{\
107: . ie \\w\\V[\\$1] .nr \\$1 \\V[\\$1]
108: . el .nr \\$1 \\$2
109: . \}
110: ..
111: .
112: .de doc-slookup
113: . if !d\\$1 \{\
114: . ie \\w\\V[\\$1] .ds \\$1 \\V[\\$1]
115: . el .ds \\$1 \\$2
116: . \}
117: ..
118: .
119: .doc-rlookup DOC_DEBUG_MODE 0
120: .doc-rlookup DOC_XR 1
121: .doc-slookup DOC_MANROOT ..
122: .
123: .nr in-pre 0
124: .nr HTML 1
125: .pl 1i
126: .po 0
127: .in 0
128: .nf
129: .nh
130: .nr list-level 0
131: .de ce
132: . ie \\$1 \{\
133: <center>
134: . nr center-on \\$1
135: . it 1 doc-center-step
136: . \}
137: . el . end-center
138: ..
139: .nr center-on 0
140: .de end-center
141: . it
142: . if \\n[center-on] </center>
143: . nr center-on 0
144: ..
145: .
146: .de doc-center-step
147: <br>
148: . nr center-on -1
149: . ie \\n[center-on]<=0 .end-center
150: . el .it 1 doc-center-step
151: ..
152: .
153: .ds copy ©
154: .ds > >
155: .ds < <
156: .ds >= >=
157: .ds <= <=
1.2 ross 158: .ds Lt <
159: .ds Gt >
1.1 ross 160: .ds & &
161: .ds _
162: .ds q "
163: .ds body-params bgcolor="#FFFFFF" text="#000000"
164: .ds document-title
165: .ds title-section
166: .ds dot-de .de
167: .ds dot-dot ..
168: .ds sepstring \~
169: .ds doc-punct-result
170: .ds doc-punct { . , : ; ( ) [ ] }
171: .ds close-mode
1.10 ross 172: .ds open-mode
1.1 ross 173: .ds recurse-prepend
174: .ds doc-anchor
1.9 ross 175: .ds Nm-save
1.1 ross 176: .ds T " x
1.11 ross 177: .ds tN <font\ size="-1">
178: .ds aa </font>
179: .ds Px \\*(tNPOSIX\\*(aa
1.1 ross 180: .chop T
181: .nr doc-dosep 0
182: .nr r-lvl 0
183: .
184: .if !dMANROOT \{\
185: . ds MANROOT \V[MANROOT]
186: . if !\w\*[MANROOT] .ds MANROOT ..
187: .\}
188: .
189: .blm Pp
190: .
191: .
192: .de DEBUG
193: .if \\n[DOC_DEBUG_MODE] \\$*
194: ..
195: .de Dd
196: . as document-title " \\$*
197: ..
198: .de Dt
199: . as document-title " \\$*
200: ..
201: .de Os
202: . as document-title " \\$*
203: . init-html
204: ..
205: .\"
206: .\"----------------------------------------------------------------------
207: .\" troff requests we translate
208: .\"
209: .rn br br-real
210: .rn sp sp-real
211: .rn fi fi-real
212: .rn nf nf-real
213: .de br
214: <br>
215: ..
216: .de sp-nice-try-ross
217: . ie !\\n(.$ <br>
218: . el .ie '\\$1'1' <br>
219: . el \{\
220: . if !\\n[in-pre] <pre>
221: . nr sp-tmp \\$1v-1v
222: . if \\n[sp-tmp]>0 .sp-real \\n[sp-tmp]u
223: . if !\\n[in-pre] </pre>
224: . \}
225: ..
226: .\" Although the above probably works, the following is a lot simpler. It
227: .\" reduces the request to 1v, but why would you put more than one adjacent
228: .\" blank line in an html document anyway?
229: .de sp
230: . ie \\n[center-on] <!-- -->
231: . el <br><br>
232: ..
233: .de end-preformat
234: . if \\n[in-pre] </pre>
235: . nr in-pre 0
236: ..
237: .de fi
238: . end-preformat
239: ..
240: .de nf
241: <br>
242: <pre>
243: . nr in-pre 1
244: ..
245: .\"
246: .\"----------------------------------------------------------------------
247: .\" Magic to open and close <body> and <html>
248: .\"
249: .de end-macro
1.10 ross 250: . if \\w\\n[.z] .ab ERROR, unclosed quotation from line \
251: \\n[quotation_line]
1.1 ross 252: . br-real \" should be unnecessary...we have fill turned off
253: . fl \" more paranoia
254: </font></body>
255: </html>
256: . br-real
257: . fl
258: ..
259: .em end-macro
260: .de init-html
261: <html>
1.8 ross 262: <head>
263: <title>
264: \\*[document-title]
265: \\*[title-section]
266: </title>
267:
268: <style type="text/css">
269: <!--
270: body { margin-left:4%; }
271: H1 { color: maroon; padding: 4pt; margin-left: -4% }
272: H2 { color: maroon; padding: 4pt; margin-left: -4% }
273: H3 { color: maroon; padding: 4pt; margin-left: -4% }
274: H4 { color: maroon; padding: 4pt; margin-left: -4% }
275: H5 { color: maroon; padding: 4pt; margin-left: -4% }
276: -->
277: </style>
278:
279: </head>
1.1 ross 280: <body \\*[body-params]>
281: \\*[dot-de] init-html
282: \\*[dot-dot]
283: ..
284: .de Lk
1.10 ross 285: . if \\n[.$]<1 .ab #\\n[.c]: Usage: .Lk href [ anchortext/punct ] ...
1.1 ross 286: . ds doc-href \\$1
287: . ds doc-anchortext \\$1
288: . shift
289: . if \\n[.$] \{\
290: . doc-checkpunct \\$1 \\*[doc-punct]
291: . if !\\n[doc-ispunct] \{\
292: . ds doc-anchortext \\$1
293: . shift
294: . \}
295: . \}
296: . ds doc-anchor <a href="\\*[doc-href]">\\*[doc-anchortext]</a>
297: . while \\n[.$] \{\
298: . doc-checkpunct \\$1 \\*[doc-punct]
1.10 ross 299: . if !\\n[doc-ispunct] .ab #\\n[.c]: .link ... '$1' -- Huh?
1.1 ross 300: . as doc-anchor \\$1
301: . shift
302: . \}
303: . ds doc-tmp1 No
304: . nr doc-tmp-2 \\w^G\\*[doc-anchortext]^G
305: . nr doc-tmp-2 \\n[doc-tmp-2]/\\w'0'
306: . if \\n[doc-tmp-2]>=30 .ds doc-tmp1 D1
307: . \\*[doc-tmp1] \\*[doc-anchor]
308: ..
309: .
310: .\".de mailto
311: .\"<a href="mailto:\\$1">\\$1</a>\\$2\\$3\\$4
312: .\"..
313: .
314: .de Ht
315: \\$*
316: ..
317: .de Sh
318: . end-preformat
319: . init-html
1.8 ross 320: <h3>
1.1 ross 321: \\$*
1.8 ross 322: </h3>
1.1 ross 323: ..
324: .de Ss
325: . end-preformat
326: . init-html
1.8 ross 327: <h4>
1.1 ross 328: <a name="\\$*">
329: \\$*
330: </a>
1.8 ross 331: </h4>
1.1 ross 332: ..
333: .
334: .de Sx
335: . end-preformat
336: . ds doc-tmp-1 "\\$1
337: . shift
338: . while \\n[.$] \{\
339: . doc-checkpunct \\$1 \\*[doc-punct]
340: . ie !\\n[doc-ispunct] .as doc-tmp-1 " \\$1
341: . el .break
342: . shift
343: . \}
344: <a href="#\\*[doc-tmp-1]">\\*[doc-tmp-1]</a>\\$1\\$2\\$3\\$4\\$5\\$6
345: ..
346: .
347: .de Pp
348: . end-preformat
349: <p>
350: ..
351: .
352: .nr doc-markbreak 0
353: .de doc-conditional-break
354: . if \\n[.c]>(\\n[doc-markbreak]+1) <br>
355: . nr doc-markbreak \\n[.c]
356: ..
357: .
358: .de D1
359: . end-preformat
360: . doc-conditional-break
361:
362: . No \\$@
363: <br>
364: ..
365: .
366: .de Dl
367: . end-preformat
368: . doc-conditional-break
369:
370: . Li \\$@
371: <br>
372: ..
373: .
374: .de Bd
375: . doc-push .Ed
376: . end-preformat
377: . nr Bd-literal 0
378: . nr Bd-offset 0
379: . ds get-file
380: . while \\n(.$ \{\
381: . if '\\$1'-literal' \{\
382: . nr Bd-literal 1
383: . shift
384: . continue
385: . \}
386: . if '\\$1'-offset' \{\
387: . shift
388: . shift
389: . nr Bd-offset 1
390: . ds start-display <dl compact><dt><dd>
391: . continue
392: . \}
393: . if '\\$1'-file' \{\
394: . ds get-file so \\$2
395: . shift
396: . shift
397: . continue
398: . \}
399: . shift
400: . \}
401: . if \\n[Bd-offset] <dl compact><dt><dd>
402: . if \\n[Bd-literal] <code>
403: <pre>\\" HOW DO WE GET RID OF THIS NEWLINE??
404: .\\*[get-file]
405: ..
406: .de Ed
407: </pre>
408: . doc-pop .Ed
409: . if \\n[Bd-literal] </code>
410: . if \\n[Bd-offset] </dl>
411: ..
412: .de Bl
413: . doc-push .El
414: . end-preformat
415: . ds list-start UNKNOWN
416: . nr bl-is-compact 0
417: . while \\n(.$ \{\
418: . if '\\$1'-width' \{\
419: . shift
420: . shift
421: . continue
422: . \}
423: . if '\\$1'-column' \{\
424: . ds list-start <center><table>
425: . ds list-end </table></center>
426: . ds list-tag-prefix <tr><td>
427: . ds list-pp-prefix
428: . shift
429: . break
430: . \}
431: . if '\\$1'-bullet' \{\
432: . ds list-start <ul>
433: . ds list-end </ul>
434: . ds list-tag-prefix <p>
435: . ds list-pp-prefix <li>
436: . shift
437: . continue
438: . \}
439: . if '\\$1'-dash' \{\
440: . ds list-start <dl>
441: . ds list-end </dl>
442: . ds list-tag-prefix <p>
443: . ds list-pp-prefix <dd>-
444: . shift
445: . continue
446: . \}
447: . if '\\$1'-enum' \{\
448: . ds list-start <ol>
449: . ds list-end </ol>
450: . ds list-tag-prefix <p>
451: . ds list-pp-prefix <li>
452: . shift
453: . continue
454: . \}
455: . if '\\$1'-hyphen' \{\
456: . ds list-start <dl>
457: . ds list-end </dl>
458: . ds list-tag-prefix <p>
459: . ds list-pp-prefix <dd>-
460: . shift
461: . continue
462: . \}
463: . if '\\$1'-item' \{\
464: . ds list-start <dl>
465: . ds list-end </dl>
466: . ds list-tag-prefix <p>
467: . ds list-pp-prefix <dd>
468: . shift
469: . continue
470: . \}
471: . if '\\$1'-tag' \{\
472: . ds list-start <dl compact>
473: . ds list-end </dl>
474: . ds list-tag-prefix <p><dt>
475: . ds list-pp-prefix <dd>
476: . shift
477: . continue
478: . \}
479: . if '\\$1'-diag' \{\
480: . ds list-start <dl compact>
481: . ds list-end </dl>
482: . ds list-tag-prefix <p><dt>
483: . ds list-pp-prefix <dd>
484: . shift
485: . continue
486: . \}
487: . if '\\$1'-hang' \{\
488: . ds list-start <dl compact>
489: . ds list-end </dl>
490: . ds list-tag-prefix <p><dt>
491: . ds list-pp-prefix <dd>
492: . shift
493: . continue
494: . \}
495: . if '\\$1'-ohang' \{\
496: . ds list-start <dl>
497: . ds list-end </dl>
498: . ds list-tag-prefix <p><dt>
499: . ds list-pp-prefix <dd>
500: . shift
501: . continue
502: . \}
503: . if '\\$1'-offset' \{\
504: . \" FIXME -- this isn't implemented
505: . shift
506: . shift
507: . continue
508: . \}
509: . if '\\$1'-compact' \{\
510: . nr bl-is-compact 1
511: . shift
512: . continue
513: . \}
514: . if '\\$1'-inset' \{\
515: . ds list-start <dl>
516: . ds list-end </dl>
517: . ds list-tag-prefix <p><dt>
518: . ds list-pp-prefix <dd>
519: . shift
520: . continue
521: . \}
1.10 ross 522: . ab Unknown .Bl list parameter \\$1 (#\\n(.c)
1.1 ross 523: . break
524: . \}
525: . if \\n[bl-is-compact] \{\
526: . if '\\*[list-tag-prefix]'<p>' .ds list-tag-prefix
527: . if '\\*[list-tag-prefix]'<p><dt>' .ds list-tag-prefix <dt>
528: . \}
1.10 ross 529: . if '\\*[list-start]'UNKNOWN' .ab \
1.1 ross 530: Unknown .Bl list type \\$1 (#\\n(.c)
531: . push-list-level start end tag-prefix pp-prefix
532: \\*[list-start]
533: ..
534: .de push-list-level
535: . nr list-level +1
536: . while \\n(.$ \{\
537: . ds list-\\$1-\\n[list-level] \\*[list-\\$1]
538: . shift
539: . \}
540: ..
541: .de pop-list-level
542: . nr list-level -1
543: ..
544: .de It-span
545: . end-preformat
546: . as doc-pcresult <tr><td colspan=9>
547: . recurse \\$@
548: . as doc-pcresult
549: . pc-fin
550: ..
551: .de It
552: . end-preformat
553: . as doc-pcresult \\*[list-tag-prefix-\\n[list-level]]
554: . recurse \\$@
555: . as doc-pcresult \\*[list-pp-prefix-\\n[list-level]]
556: . pc-fin
557: ..
558: .de El
559: . doc-pop .El
560: \\*[list-end-\\n[list-level]]
561: . pop-list-level
562: ..
563: .de Lb
564: .if !\\n(.$==1 .tm Usage: .Lb [library name]
565: .if "\\$1"libarm32" \&ARM32 Architecture Library (libarm32, -larm32)
566: .if "\\$1"libi386" \&i386 Architecture Library (libi386, -li386)
567: .if "\\$1"libc" \&Standard C Library (libc, -lc)
568: .if "\\$1"libcompat" \&Compatibility Library (libcompat, -lcompat)
569: .if "\\$1"libcrypt" \&Crypt Library (libcrypt, -lcrypt)
570: .if "\\$1"libcurses" \&Curses Library (libcurses, -lcurses)
571: .if "\\$1"libedit" \&Command Line Editor Library (libedit, -ledit)
1.12 itojun 572: .if "\\$1"libipsec" \&IPsec Policy Control Library (libipsec, -lipsec)
1.1 ross 573: .if "\\$1"libkvm" \&Kernel Data Access Library (libkvm, -lkvm)
574: .if "\\$1"libm" \&Math Library (libm, -lm)
1.13 kleink 575: .if "\\$1"libmenu" \&Curses Menu Library (libmenu, -lmenu)
1.1 ross 576: .if "\\$1"libossaudio" \&OSS Audio Emulation Library (libossaudio, -lossaudio)
577: .if "\\$1"libposix" \&POSIX Compatibility Library (libposix, -lposix)
578: .if "\\$1"libresolv" \&DNS Resolver Library (libresolv, -lresolv)
579: .if "\\$1"libtermcap" \&Termcap Access Library (libtermcap, -ltermcap)
580: .if "\\$1"libutil" \&System Utilities Library (libutil, -lutil)
581: .if "\\$1"libz" \&Compression Library (libz, -lz)
582: ..
583: .
584: .
585: .de doc-checkpunct
586: . ds doc-cp-tmp1 \\$1
587: . shift
588: . nr doc-ispunct 0
589: . while \\n[.$] \{\
590: . if \\*[doc-cp-tmp1]\\$1 .nr doc-ispunct 1
591: . shift
592: . \}
593: ..
594: .\"
595: .\" Parsed and Callable macros
596: .\"
597: .\" Internal structure: `recurse' and `mode-*-{on,off}'
598: .\"
599: .de recurse
600: . nr r-lvl +1
601: . ds active-prepend \\*[recurse-prepend]
602: .DEBUG .tm r \\n[r-lvl] __\\*[doc-pcresult]==\\$@__
603: . while \\n(.$ \{\
604: . doc-checkpunct \\$1 \\*[doc-punct]
605: . if \\n[doc-ispunct] \{\
606: . as doc-punct-result \\$1
607: . shift
608: . continue
609: . \}
610: . nr is-request \\A'\\$1'
611: . if \\n[is-request] \{\
612: . if ddoc2html@@\\$1 .nr is-request 1
613: . if !ddoc2html@@\\$1 .nr is-request 0
614: . \}
615: . ie \\n[is-request] \{\
616: . ds recurse-tmp1 \\$1
617: . shift
618: . if \\w?\\*[active-prepend]?&\\w?\\*[recurse-prepend]? \{\
1.10 ross 619: . if \\n[doc-dosep] .as doc-pcresult \\*[sepstring]
620: . as doc-pcresult "\\*[active-prepend]
1.1 ross 621: . nr doc-dosep 0
622: . \}
623: . ds recurse-prepend
624: . \\*[recurse-tmp1] \\$@
625: . break
626: . \}
627: . el \{\
628: .DEBUG .tm r \\n[r-lvl] __\\*[doc-pcresult]+\\$1==\\$@__
629: . \" a random word, so output saved punctuation
630: . \" (normally saved until level 0 mode closure )
1.10 ross 631: . if \\w\\*[doc-pcresult] \{\
632: . as doc-pcresult \\*[close-mode]
633: . as doc-pcresult \\*[doc-punct-result]
634: . as doc-pcresult \\*[open-mode]
635: . ds doc-punct-result
636: . \}
1.1 ross 637: . if \\n[doc-dosep] .as doc-pcresult \\*[sepstring]
638: . nr doc-dosep 1
639: . as doc-pcresult \\*[active-prepend]\\$1
640: . ds recurse-prepend
641: . shift
642: . continue
643: . \}
644: . \}
645: . nr r-lvl -1
646: ..
1.10 ross 647: .
648: .de resetmode
649: . ds open-mode
650: . ds close-mode
651: ..
652: .
1.1 ross 653: .de make-mode
654: \\*[dot-de] mode-\\$1-on
655: . DEBUG .tm mode-\\$1-on <\\\\$@>
656: . rn close-mode xclose-mode
1.10 ross 657: . ds open-mode \\$2
1.1 ross 658: . ds close-mode \\$3
659: . as doc-pcresult \\\\*[xclose-mode]\\$2
660: \\*[dot-dot]
661: \\*[dot-de] mode-\\$1-off
662: . DEBUG .tm mode-\\$1-off <\\\\$@>
663: . as doc-pcresult \\\\*[close-mode]
1.10 ross 664: . resetmode
1.1 ross 665: \\*[dot-dot]
666: ..
667: .de pc-fin
668: . as doc-pcresult \\$1
669: . if \\n[r-lvl]=0 \{\\*[doc-pcresult]\\*[doc-punct-result]
670: . ds doc-punct-result
671: . rm doc-pcresult
672: . ds sepstring \~
673: . nr doc-dosep 0
674: . \}
675: ..
1.10 ross 676: .
1.1 ross 677: .make-mode bold <b> </b>
678: .make-mode code <code> </code>
679: .make-mode em <em> </em>
680: .make-mode i <i> </i>
681: .make-mode caps <font\ size="-1"> <font\ size="+0">
1.3 ross 682: .make-mode null \& \&
1.11 ross 683: .make-mode function <code> </code>
1.1 ross 684: .am mode-i-on
1.10 ross 685: . ds sepstring \~
1.1 ross 686: ..
687: .am mode-em-on
1.10 ross 688: . ds sepstring \~
1.1 ross 689: ..
690: .am mode-i-off
691: . ds sepstring \~
692: ..
693: .am mode-em-off
694: . ds sepstring \~
695: ..
696: .
697: .de doc-sep-append
698: . if \\n[doc-dosep] .as doc-pcresult \~
699: . as doc-pcresult \\$1
700: . nr doc-dosep 0
701: ..
702: .de No
703: . as doc-pcresult \\*[close-mode]
1.10 ross 704: . resetmode
1.1 ross 705: . recurse \\$@
706: . pc-fin
707: ..
708: .de Fl
709: .DEBUG .tm .Fl \\$*
710: . mode-bold-on
711: . ds recurse-prepend -
712: . recurse \\$@
713: . mode-bold-off
714: . pc-fin
715: ..
716: .de Cm
717: .DEBUG .tm .Cm \\$*
718: . mode-bold-on
719: . recurse \\$@
720: . mode-bold-off
1.5 mycroft 721: . pc-fin
722: ..
1.1 ross 723: .de Op
724: .DEBUG .tm .Op \\$*
725: . as doc-pcresult \&[
726: . recurse \\$@
727: . pc-fin \&]
728: ..
729: .de Em
730: .DEBUG .tm .Em \\$*
731: . mode-em-on
732: . recurse \\$@
733: . mode-em-off
734: . pc-fin
735: ..
736: .de Fx
737: .DEBUG .tm .Fx \\$*
738: . as doc-pcresult FreeBSD
739: . recurse \\$@
740: ..
741: .de Nm
1.8 ross 742: . ds Nm-result \\*[Nm-save]
1.1 ross 743: . if \\n(.$ \{\
1.10 ross 744: . ie '\\$1'' .br-real
1.1 ross 745: . el \{\
1.8 ross 746: . ds Nm-result \\$1
747: . if '\\*[Nm-save]'' .ds Nm-save \\$1
1.1 ross 748: . shift
749: . \}
750: . \}
751: . mode-bold-on
1.8 ross 752: . as doc-pcresult \\*[Nm-result]
1.1 ross 753: . recurse \\$@
754: . mode-bold-off
755: . pc-fin
756: ..
757: .de Nd
758: .DEBUG .tm .Nd \\$*
759: - \\$*
760: ..
761: .de At
762: AT&T UNIX\\$*
763: ..
764: .de Lk
765: . as doc-pcresult <a href="\\$1">\\$1</a>
766: . shift
767: . recurse \\$@
768: . pc-fin
769: ..
770: .de Mt
771: . as doc-pcresult <a href="mailto:\\$1">\\$1</a>
772: . shift
773: . recurse \\$@
774: . pc-fin
775: ..
776: .de Ta
777: . as doc-pcresult <td>
778: . recurse \\$@
779: . pc-fin
780: ..
781: .de Bx
782: . doc-checkpunct \\$1 \\*[doc-punct]
783: . if !\\n[doc-ispunct] \{\
784: . as doc-pcresult \\$1
785: . shift
786: . \}
787: . as doc-pcresult BSD
788: . recurse \\$@
789: . pc-fin
790: ..
791: .de Nx
792: . as doc-pcresult NetBSD
793: . recurse \\$@
794: . pc-fin
795: ..
796: .de Ux
797: . as doc-pcresult UNIX
798: . recurse \\$@
799: . pc-fin
800: ..
801: .de Ql
802: . as doc-pcresult `
803: . recurse \\$@
804: . pc-fin \&'
805: ..
806: .de Pf
807: . as doc-pcresult \\$1
808: . shift
809: . nr doc-dosep 0
810: . recurse \\$@
811: . pc-fin
812: ..
813: .de Ns
814: . nr doc-dosep 0
1.3 ross 815: . mode-null-on
1.1 ross 816: . recurse \\$@
1.3 ross 817: . mode-null-off
1.1 ross 818: . pc-fin
819: ..
820: .
1.10 ross 821: .de doc-start-quote
822: . if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
823: . as doc-pcresult \\$1
824: . nr doc-dosep 0
825: ..
826: .
827: .de safe-blm
828: ..
829: .
830: .de doc-quote-open
831: . blm safe-blm
1.1 ross 832: . if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
833: . nr doc-dosep 0
1.10 ross 834: . ev quotation_ev
835: . di quotation
836: . br-real
837: . nr quotation_line \\n[.c]
838: ..
839: .
840: .de general-close
841: . if \\w\\n[.z]=0 .Error no quotation is open
842: . br-real
843: . di
844: . ev
845: . if \\w\\n[.z]>0 \{\
846: . tm Already in a diversion?! \\n[.z]
847: . backtrace
848: . Error multiple diversions: two quotations open?
849: . \}
850: . if \\n[dn]=0 \{\
851: .tm gb1 \\n[dn] \\n[dl]
852: . ev quotation_ev
853: . br-real
854: . da quotation
855: . nf
856: .
857: . di
858: . ev
859: .tm gb2 \\n[dn] \\n[dl]
860: . \}
861: . as doc-pcresult \\$1\\*[quotation]\\
862: .
863: .
864: . blm Pp
1.1 ross 865: ..
866: .
867: .de make-quoter
868: \\*[dot-de] \\$1o
1.10 ross 869: . doc-quote-open
1.1 ross 870: . recurse \\\\$@
871: . pc-fin
872: \\*[dot-dot]
873: \\*[dot-de] \\$1c
1.10 ross 874: . general-close \\$2
875: . shift
876: . recurse \\\\$@ \\$3
877: . pc-fin
1.1 ross 878: \\*[dot-dot]
879: \\*[dot-de] \\$1q
880: . doc-start-quote \\$2
881: . recurse \\\\$@
882: . pc-fin \\$3
883: \\*[dot-dot]
884: ..
1.10 ross 885: .
1.7 mycroft 886: .\" generate Aq Ao Ac Bq Bo Bc Dq Do Dc Pq Po Pc Qq Qo Qc Sq So Sc Oo Oc
1.1 ross 887: .make-quoter A < >
1.6 mycroft 888: .make-quoter B \&[ \&]
889: .make-quoter D \&`` \&''
890: .make-quoter P \&( \&)
1.1 ross 891: .make-quoter Q \&" \&"
1.6 mycroft 892: .make-quoter S \&` \&'
893: .als Oo Bo
894: .als Oc Bc
1.10 ross 895: .de Error
896: . ab Line \\n[.c], Error: \\$*
897: ..
1.1 ross 898: .de Ft
899: . as doc-pcresult <br><br>
900: . mode-code-on
901: . recurse \\$@
902: . mode-code-off
903: . pc-fin
904: ..
905: .de Fn
906: . mode-bold-on
907: . as doc-pcresult "\\$1
908: . shift
909: . mode-bold-off
910: . as doc-pcresult (
1.10 ross 911: . mode-function-on
1.8 ross 912: . ds sepstring , \" (need the space)
1.1 ross 913: . recurse \\$@
1.11 ross 914: . as doc-pcresult \\*[close-mode])
1.10 ross 915: . pc-fin
1.1 ross 916: ..
917: .de Fo
918: . mode-bold-on
919: . as doc-pcresult "\\$1
920: . shift
921: . mode-bold-off
922: . as doc-pcresult (
923: . mode-code-on
924: . recurse \\$@
925: . mode-code-off
926: . pc-fin
927: ..
928: .de Fc
929: . recurse \\$@
930: . pc-fin )
931: ..
932: .de Ar
933: . mode-i-on
934: . recurse \\$@
935: . mode-i-off
936: . pc-fin
937: ..
938: .de Ic
939: . mode-bold-on
940: . recurse \\$@
941: . mode-bold-off
942: . pc-fin
943: ..
944: .de Fa
945: . mode-code-on
946: . recurse \\$@
947: . mode-code-off
948: . pc-fin
949: ..
950: .de Xr
951: . ie \\n[DOC_XR] \{\
952: . mode-code-on
1.10 ross 953: . ie \\w\\$2=0 .as doc-pcresult \\$1
954: . el .as doc-pcresult \\$1(\\$2)
1.1 ross 955: . mode-code-off
956: . \}
957: . el \{\
958: . as doc-pcresult <a href="\\*[DOC_MANROOT]/html\\$2/m_\\$1.html">
1.10 ross 959: . ie \\w\\$2=0 .as doc-pcresult \\$1
960: . el .as doc-pcresult \\$1(\\$2)
961: . as doc-pcresult </a>
1.1 ross 962: . \}
963: . shift
964: . shift
965: . recurse \\$@
966: . pc-fin
967: ..
968: .de Dv
969: . mode-code-on
970: . recurse \\$@
971: . mode-code-off
972: . pc-fin
973: ..
974: .de Ic
975: . mode-bold-on
976: . recurse \\$@
977: . mode-bold-off
978: . pc-fin
979: ..
980: .de Pa
981: . mode-code-on
982: . recurse \\$@
983: . mode-code-off
984: . pc-fin
985: ..
986: .de Tn
987: . mode-caps-on
988: . recurse \\$@
989: . mode-caps-off
990: . pc-fin
991: ..
992: .de Fd
993: . as doc-pcresult <br>
994: . mode-bold-on
995: . recurse \\$@
996: . mode-bold-off
997: . pc-fin
998: ..
999: .de Va
1000: . mode-i-on
1001: . recurse \\$@
1002: . mode-i-off
1003: . pc-fin
1004: ..
1005: .de Li
1006: . mode-code-on
1007: . recurse \\$@
1008: . mode-code-off
1009: . pc-fin
1010: ..
1011: .de Sy
1012: . mode-bold-on
1013: . recurse \\$@
1014: . mode-bold-off
1015: . pc-fin
1016: ..
1017: .de Me
1018: . mode-bold-on
1019: . recurse \\$@
1020: . mode-bold-off
1021: . pc-fin
1022: ..
1023: .de Ev
1024: . mode-code-on
1025: . recurse \\$@
1026: . mode-code-off
1027: . pc-fin
1028: ..
1029: .de Cd
1030: . mode-bold-on
1031: . recurse \\$@
1032: . mode-bold-off
1033: . pc-fin
1034: ..
1035: .ig
1036: I used to have a caps-code mode for Er. But <code> apparently
1037: already implies a small mode or maybe actually small caps mode.
1038: ..
1039: .de Er
1040: . mode-code-on
1041: . recurse \\$@
1042: . mode-code-off
1043: . pc-fin
1044: ..
1045: .de St
1046: . ie \\n(.$==0 \{\
1047: . tm The .St (expand standard name) macro requires >= 1 arg
1048: . \}
1049: . el \{\
1050: . ds std-tmp1 ERROR
1051: . if "\\$1"-p1003.1-96" \{\
1.15 kleink 1052: . ds std-tmp1 \&ISO/IEC 9945-1:1996
1.1 ross 1053: . as std-tmp1 " \"exactly one space
1054: . as std-tmp1 (``\\*(Px'')
1055: . \}
1056: . if "\\$1"-p1003.1c-95" \{\
1057: . ds std-tmp1 \&IEEE Std1003.1c-1995
1058: . as std-tmp1 " \"exactly one space
1059: . as std-tmp1 (``\\*(Px'')
1060: . \}
1061: . if "\\$1"-p1003.1b-93" \{\
1062: . ds std-tmp1 \&IEEE Std1003.1b-1993
1063: . as std-tmp1 " \"exactly one space
1064: . as std-tmp1 (``\\*(Px'')
1065: . \}
1066: . if "\\$1"-p1003.1-90" \{\
1067: . ds std-tmp1 \&IEEE Std1003.1-1990
1068: . as std-tmp1 " \"exactly one space
1069: . as std-tmp1 (``\\*(Px'')
1070: . \}
1071: . if "\\$1"-p1003.1-88" \{\
1072: . ds std-tmp1 \&IEEE Std1003.1-1988
1073: . as std-tmp1 " \"exactly one space
1074: . as std-tmp1 (``\\*(Px'')
1075: . \}
1076: . if "\\$1"-p1003.1" \{\
1077: . ds std-tmp1 \&IEEE Std1003.1
1078: . as std-tmp1 " \"exactly one space
1079: . as std-tmp1 (``\\*(Px'')
1080: . \}
1081: . if "\\$1"-p1003.2-92" \{\
1082: . ds std-tmp1 \&IEEE Std1003.2-1992
1083: . as std-tmp1 " \"exactly one space
1084: . as std-tmp1 (``\\*(Px.2'')
1085: . \}
1086: . if "\\$1"-p1003.2" \{\
1087: . ds std-tmp1 \&IEEE Std1003.2
1088: . as std-tmp1 " \"exactly one space
1089: . as std-tmp1 (``\\*(Px.2'')
1.18 ! kleink 1090: . \}
! 1091: . if "\\$1"-isoC" \{\
! 1092: . ds std-tmp1 \&ISO/IEC 9899:1990
! 1093: . as std-tmp1 " \"exactly one space
! 1094: . as std-tmp1 (``ISO C90'')
! 1095: . \}
! 1096: . if "\\$1"-isoC-amd1" \{\
! 1097: . ds std-tmp1 \&ISO/IEC 9899/AMD1:1990
! 1098: . as std-tmp1 " \"exactly one space
! 1099: . as std-tmp1 (``ISO C90'')
! 1100: . \}
! 1101: . if "\\$1"-isoC-amd2" \{\
! 1102: . ds std-tmp1 \&ISO/IEC 9899/AMD2:1990
! 1103: . as std-tmp1 " \"exactly one space
! 1104: . as std-tmp1 (``ISO C90'')
! 1105: . \}
! 1106: . if "\\$1"-isoC-tcor1" \{\
! 1107: . ds std-tmp1 \&ISO/IEC 9899/TCOR1:1990
! 1108: . as std-tmp1 " \"exactly one space
! 1109: . as std-tmp1 (``ISO C90'')
! 1110: . \}
! 1111: . if "\\$1"-isoC-tcor2" \{\
! 1112: . ds std-tmp1 \&ISO/IEC 9899/TCOR2:1990
! 1113: . as std-tmp1 " \"exactly one space
! 1114: . as std-tmp1 (``ISO C90'')
1.1 ross 1115: . \}
1.16 kleink 1116: . if "\\$1"-isoC99" \{\
1117: . ds std-tmp1 \&ISO/IEC 9899:1999
1118: . as std-tmp1 " \"exactly one space
1119: . as std-tmp1 (``ISO C99'')
1120: . \}
1.1 ross 1121: . if "\\$1"-ansiC" \{\
1122: . ds std-tmp1 \&ANSI X3.159-1989
1123: . as std-tmp1 " \"exactly one space
1124: . as std-tmp1 (``ANSI C'')
1125: . \}
1126: . if "\\$1"-ansiC-89" \{\
1127: . ds std-tmp1 \&ANSI X3.159-1989
1128: . as std-tmp1 " \"exactly one space
1129: . as std-tmp1 (``ANSI C'')
1130: . \}
1131: . if "\\$1"-ieee754" \{\
1132: . ds std-tmp1 \&IEEE Std754-1985
1133: . \}
1134: . if "\\$1"-iso8802-3" \{\
1.16 kleink 1135: . ds std-tmp1 \&ISO 8802-3:1989
1.1 ross 1136: . \}
1137: . if "\\$1"-xpg3" \{\
1.11 ross 1138: . ds std-tmp1 X/Open Portability Guide Issue 3
1.1 ross 1139: . as std-tmp1 " \"exactly one space
1140: . as std-tmp1 (``XPG3'')
1141: . \}
1142: . if "\\$1"-xpg4" \{\
1.11 ross 1143: . ds std-tmp1 X/Open Portability Guide Issue 4
1.1 ross 1144: . as std-tmp1 " \"exactly one space
1145: . as std-tmp1 (``XPG4'')
1146: . \}
1147: . if "\\$1"-xpg4.2" \{\
1.11 ross 1148: . ds std-tmp1 X/Open Portability Guide Issue 4.2
1.1 ross 1149: . as std-tmp1 " \"exactly one space
1150: . as std-tmp1 (``XPG4.2'')
1.11 ross 1151: . \}
1152: . if "\\$1"-xbd5" \{\
1153: . ds std-tmp1 X/Open System Interface Definitions Issue 5
1154: . as std-tmp1 " \"exactly one space
1155: . as std-tmp1 (``\\*(tNXBD5\\*(aa'')
1156: . \}
1157: . if "\\$1"-xcu5" \{\
1158: . ds std-tmp1 X/Open Commands and Utilities Issue 5
1159: . as std-tmp1 " \"exactly one space
1160: . as std-tmp1 (``\\*(tNXCU5\\*(aa'')
1161: . \}
1162: . if "\\$1"-xsh5" \{\
1163: . ds std-tmp1 X/Open System Interfaces and Headers Issue 5
1164: . as std-tmp1 " \"exactly one space
1165: . as std-tmp1 (``\\*(tNXSH5\\*(aa'')
1166: . \}
1167: . if "\\$1"-xns5" \{\
1168: . ds std-tmp1 X/Open Networking Services Issue 5
1169: . as std-tmp1 " \"exactly one space
1170: . as std-tmp1 (``\\*(tNXNS5\\*(aa'')
1171: . \}
1172: . if "\\$1"-xcurses4.2" \{\
1173: . ds std-tmp1 X/Open Curses Issue 4 Version 2
1174: . as std-tmp1 " \"exactly one space
1175: . as std-tmp1 (``\\*(tNXCURSES4.2\\*(aa'')
1.4 kleink 1176: . \}
1177: . if "\\$1"-svid4" \{\
1178: . ds std-tmp1 \&System V Interface Definition,
1179: . as std-tmp1 " \"exactly one space
1180: . as std-tmp1 \&Fourth Edition
1181: . as std-tmp1 " \"exactly one space
1182: . as std-tmp1 (``SVID4'')
1.1 ross 1183: . \}
1184: . if "\\*[std-tmp1]"ERROR" .tm ERROR, no such std: .St \\$*
1185: . shift
1186: . as doc-pcresult \~\\*[std-tmp1]\~
1187: . recurse \\$@
1188: . pc-fin
1189: . \}
1190: ..
1191: .ig
1192: I've observed that <code> does decent things with caps, and it should
1193: be reminiscent of the old typewriter-style unix logos.
1194: ..
1195: .de At
1196: . if \\n(.$==2 \{\
1197: . if "\\$1"32v" Version 32V <code>AT&T UNIX</code>\\$2
1198: . if "\\$1"V" \<code>AT&T</code> System V <code>UNIX</code>\\$2
1199: . if "\\$1"V.1" <code>AT&T</code> System V.1 <code>UNIX</code>\\$2
1200: . if "\\$1"V.2" <code>AT&T</code> System V.2 <code>UNIX</code>\\$2
1201: . if "\\$1"V.3" <code>AT&T</code> System V.3 <code>UNIX</code>\\$2
1202: . if "\\$1"V.4" <code>AT&T</code> System V.4 <code>UNIX</code>\\$2
1203: . if "\\$1"v5" Version 5 <code>AT&T UNIX</code>\\$2
1204: . if "\\$1"v6" Version 6 <code>AT&T UNIX</code>\\$2
1205: . if "\\$1"v7" Version 7 <code>AT&T UNIX</code>\\$2
1206: . \}
1207: . if \\n(.$==1 \{\
1208: . if "\\$1"32v" Version 32V <code>AT&T UNIX</code>
1209: . if "\\$1"V" <code>AT&T</code> System V <code>UNIX</code>
1210: . if "\\$1"V.1" <code>AT&T</code> System V.1 <code>UNIX</code>
1211: . if "\\$1"V.2" <code>AT&T</code> System V.2 <code>UNIX</code>
1212: . if "\\$1"V.3" <code>AT&T</code> System V.3 <code>UNIX</code>
1213: . if "\\$1"V.4" <code>AT&T</code> System V.4 <code>UNIX</code>
1214: . if "\\$1"v6" Version 6 <code>AT&T UNIX</code>
1215: . if "\\$1"v7" Version 7 <code>AT&T UNIX</code>
1216: . \}
1217: . if \\n(.$==0 \{\
1218: . if 1 <code>AT&T UNIX</code>
1219: . \}
1220: ..
1221: .\"----------------------------------------------------------------------
1222: .\"
1223: .\" There must be a doc2html alias for all callable macros
1224: .\"
1225: .als doc2html@@Dd Dd
1226: .als doc2html@@Dt Dt
1227: .als doc2html@@Os Os
1228: .als doc2html@@br br
1229: .als doc2html@@sp sp
1230: .als doc2html@@fi fi
1231: .als doc2html@@nf nf
1232: .als doc2html@@Sh Sh
1233: .als doc2html@@Ss Ss
1234: .als doc2html@@Pp Pp
1235: .als doc2html@@D1 D1
1236: .als doc2html@@Dl Dl
1237: .als doc2html@@Bd Bd
1238: .als doc2html@@Ed Ed
1239: .als doc2html@@Bl Bl
1240: .als doc2html@@It It
1241: .als doc2html@@El El
1242: .als doc2html@@Fl Fl
1243: .als doc2html@@Cm Cm
1244: .als doc2html@@Op Op
1245: .als doc2html@@Em Em
1246: .als doc2html@@Fx Fx
1247: .als doc2html@@Nm Nm
1248: .als doc2html@@Nd Nd
1249: .als doc2html@@At At
1250: .als doc2html@@Bx Bx
1251: .als doc2html@@Nx Nx
1252: .als doc2html@@Ux Ux
1253: .als doc2html@@Ql Ql
1254: .als doc2html@@Pf Pf
1255: .als doc2html@@Ns Ns
1256: .als doc2html@@Ft Ft
1257: .als doc2html@@Fn Fn
1258: .als doc2html@@Fo Fo
1259: .als doc2html@@Fc Fc
1260: .als doc2html@@Ar Ar
1261: .als doc2html@@Ic Ic
1262: .als doc2html@@Fa Fa
1263: .als doc2html@@Xr Xr
1264: .als doc2html@@Dv Dv
1265: .als doc2html@@Ic Ic
1266: .als doc2html@@Pa Pa
1267: .als doc2html@@Tn Tn
1268: .als doc2html@@Fd Fd
1269: .als doc2html@@Va Va
1270: .als doc2html@@Li Li
1271: .als doc2html@@Sy Sy
1272: .als doc2html@@Me Me
1273: .als doc2html@@Ev Ev
1274: .als doc2html@@Cd Cd
1275: .als doc2html@@St St
1276: .als doc2html@@Er Er
1277: .als doc2html@@Aq Aq
1278: .als doc2html@@Ao Ao
1279: .als doc2html@@Ac Ac
1280: .als doc2html@@Bq Bq
1281: .als doc2html@@Bo Bo
1282: .als doc2html@@Bc Bc
1283: .als doc2html@@Dq Dq
1284: .als doc2html@@Do Do
1285: .als doc2html@@Dc Dc
1286: .als doc2html@@Qq Qq
1287: .als doc2html@@Qo Qo
1288: .als doc2html@@Qc Qc
1.7 mycroft 1289: .als doc2html@@Pq Pq
1290: .als doc2html@@Po Po
1291: .als doc2html@@Pc Pc
1.1 ross 1292: .als doc2html@@Sq Sq
1293: .als doc2html@@So So
1294: .als doc2html@@Sc Sc
1.7 mycroft 1295: .als doc2html@@Oo Oo
1296: .als doc2html@@Oc Oc
1.1 ross 1297: .als doc2html@@Ta Ta
1298: .als doc2html@@Mt Mt
1299: .als doc2html@@Lk Lk
1300: .als doc2html@@No No
1301: .
1302: .rn em doc-real-em
1303: .de em
1.10 ross 1304: . tm Hint: Should this have been .Em ...?
1305: . Error end-macro (.em) respecification is not allowed.
1.1 ross 1306: ..
1307: .
1308: .ig
1309: ----------------------------------------------------------------------
1310: ----------------------------------------------------------------------
1311: ----------------------------------------------------------------------
1312: THESE ARE THE -man (-man.old) MACRO FUNCTIONS
1313:
1314: Internal symbols relating to -man are prefixed with mo-
1315: The body-params string used with -mdoc2html is used here as well.
1316: ..
1317: .de TH
1318: <html>
1319: <title>
1320: \\$*
1321: .nr mo-section \\$2
1322: </title>
1323: <body \\*[body-params]>
1324: ..
1325: .de SH
1326: . end-preformat
1327: . mo-end-dl
1.8 ross 1328: <h3> \\$* </h3>
1.1 ross 1329: ..
1330: .de SS
1331: . end-preformat
1332: . mo-end-dl
1.8 ross 1333: <h4> \\$* </h4>
1.1 ross 1334: ..
1335: .de B
1336: . ie \\n(.$ <b>\&\\$*</b>
1337: . el \{\
1338: . if 1 <b>
1339: . it 1 mo-end-bold
1340: . \}
1341: ..
1342: .de I
1343: . it 1 mo-end-italic
1344: . ie \\n(.$ <i>\&\\$*</i>
1345: . el \{\
1346: . if 1 <i>
1347: . it 1 mo-end-bold
1348: . \}
1349: ..
1350: .de mo-end-bold
1351: </b>
1352: ..
1353: .de mo-end-italic
1354: </i>
1355: ..
1356: .de SM
1357: <font size=-1>
1358: . it 1 mo-end-smallcaps
1359: . if \\n(.$ \&\\$*
1360: ..
1361: .de mo-end-smallcaps
1362: <font size=+0>
1363: ..
1364: .de BI
1365: . mo-try-link \\$1 \\$2
1366: . if !\\n[mo-did-link] \{\
1367: . ds mo-bi-tmp1
1368: . while \\n(.$>=2 \{\
1369: . as mo-bi-tmp1 <b>\\$1</b><i>\\$2</i>
1370: . shift
1371: . shift
1372: . \}
1373: . as mo-bi-tmp1 \\$*
1374: \&\\*[mo-bi-tmp1]
1375: . \}
1376: ..
1377: .de BR
1378: . mo-try-link \\$1 \\$2
1379: . if !\\n[mo-did-link] \{\
1380: . ds mo-bi-tmp1
1381: . while \\n(.$>=2 \{\
1382: . as mo-bi-tmp1 <b>\\$1</b>\\$2
1383: . shift
1384: . shift
1385: . \}
1386: . as mo-bi-tmp1 \\$*
1387: \&\\*[mo-bi-tmp1]
1388: . \}
1389: ..
1390: .de IB
1391: . mo-try-link \\$1 \\$2
1392: . if !\\n[mo-did-link] \{\
1393: . ds mo-bi-tmp1
1394: . while \\n(.$>=2 \{\
1395: . as mo-bi-tmp1 <i>\\$1</i><b>\\$2</b>
1396: . shift
1397: . shift
1398: . \}
1399: . as mo-bi-tmp1 \\$*
1400: \&\\*[mo-bi-tmp1]
1401: . \}
1402: ..
1403: .de IR
1404: . mo-try-link \\$1 \\$2
1405: . if !\\n[mo-did-link] \{\
1406: . ds mo-bi-tmp1
1407: . while \\n(.$>=2 \{\
1408: . as mo-bi-tmp1 <i>\\$1</i>\\$2
1409: . shift
1410: . shift
1411: . \}
1412: . as mo-bi-tmp1 \\$*
1413: \&\\*[mo-bi-tmp1]
1414: . \}
1415: ..
1416: .de CT
1417: \&<<font size=-1>CTRL/<font size=+0>\\$*>
1418: ..
1419: .de DS
1420: <code><pre>
1421: ..
1422: .de DE
1423: </pre></code>
1424: ..
1425: .als Ds DS
1426: .als De DE
1427: .als EX DS
1428: .als EE DE
1429: .de TP
1430: . mo-start-dl
1431: <dt>
1432: . it 1 mo-dd
1433: ..
1434: .de IP
1435: . mo-start-dl
1436: <dt>
1437: <b>\\$1</b>
1438: . it 1 mo-dd
1439: ..
1440: .de mo-start-dl
1441: . end-preformat
1442: . if !\\n[mo-in-dl] <dl compact>
1443: . nr mo-in-dl 1
1444: ..
1445: .de mo-dd
1446: <dd>
1447: ..
1448: .de mo-end-dl
1449: . if \\n[mo-in-dl] </dl>
1450: . nr mo-in-dl 0
1451: ..
1452: .de P
1453: . end-preformat
1454: . mo-end-dl
1455: <p>
1456: ..
1457: .als PP P
1458: .als LP P
1459: .de mo-try-link
1460: . nr mo-did-link 0
1461: . if \\A'\\$2' \{\
1462: . if \\w'\\*[\\$2]' \{\
1463: . Xr \\$1 \\*[\\$2]
1464: . nr mo-did-link 1
1465: . \}
1466: . \}
1467: ..
1468: .ds (1) 1
1469: .ds (2) 2
1470: .ds (3) 3
1471: .ds (4) 4
1472: .ds (5) 5
1473: .ds (6) 6
1474: .ds (7) 7
1475: .ds (8) 8
1476: .ds (9) 9
1477: .ds (1), 1
1478: .ds (2), 2
1479: .ds (3), 3
1480: .ds (4), 4
1481: .ds (5), 5
1482: .ds (6), 6
1483: .ds (7), 7
1484: .ds (8), 8
1485: .ds (9), 9
1486: .ds (1). 1
1487: .ds (2). 2
1488: .ds (3). 3
1489: .ds (4). 4
1490: .ds (5). 5
1491: .ds (6). 6
1492: .ds (7). 7
1493: .ds (8). 8
1494: .ds (9). 9
CVSweb <webmaster@jp.NetBSD.org>