Annotation of mandoc/mandoc.1, Revision 1.136
1.136 ! schwarze 1: .\" $Id: mandoc.1,v 1.135 2015/01/24 01:58:33 schwarze Exp $
1.1 kristaps 2: .\"
1.92 schwarze 3: .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
1.131 schwarze 4: .\" Copyright (c) 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
1.1 kristaps 5: .\"
6: .\" Permission to use, copy, modify, and distribute this software for any
1.16 kristaps 7: .\" purpose with or without fee is hereby granted, provided that the above
8: .\" copyright notice and this permission notice appear in all copies.
1.1 kristaps 9: .\"
1.16 kristaps 10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 kristaps 17: .\"
1.136 ! schwarze 18: .Dd $Mdocdate: January 24 2015 $
1.14 kristaps 19: .Dt MANDOC 1
1.1 kristaps 20: .Os
21: .Sh NAME
22: .Nm mandoc
1.8 kristaps 23: .Nd format and display UNIX manuals
1.1 kristaps 24: .Sh SYNOPSIS
25: .Nm mandoc
1.110 schwarze 26: .Op Fl acfhklV
1.101 schwarze 27: .Sm off
28: .Op Fl I Cm os Li = Ar name
29: .Sm on
1.121 schwarze 30: .Op Fl K Ns Ar encoding
1.8 kristaps 31: .Op Fl m Ns Ar format
1.58 kristaps 32: .Op Fl O Ns Ar option
1.37 kristaps 33: .Op Fl T Ns Ar output
1.77 schwarze 34: .Op Fl W Ns Ar level
1.89 kristaps 35: .Op Ar
1.1 kristaps 36: .Sh DESCRIPTION
37: The
38: .Nm
1.26 kristaps 39: utility formats
1.8 kristaps 40: .Ux
1.57 kristaps 41: manual pages for display.
1.100 kristaps 42: .Pp
43: By default,
44: .Nm
45: reads
46: .Xr mdoc 7
47: or
48: .Xr man 7
49: text from stdin, implying
50: .Fl m Ns Cm andoc ,
51: and produces
1.128 schwarze 52: .Fl T Ns Cm locale
1.100 kristaps 53: output.
54: .Pp
1.109 schwarze 55: The options are as follows:
1.19 kristaps 56: .Bl -tag -width Ds
1.107 schwarze 57: .It Fl a
58: If the standard output is a terminal device and
59: .Fl c
60: is not specified, use
61: .Xr more 1
62: to paginate the output, just like
63: .Xr man 1
64: would.
65: .It Fl c
66: Copy the formatted manual pages to the standard output without using
67: .Xr more 1
68: to paginate them.
69: This is the default.
70: It can be specified to override
71: .Fl a .
1.109 schwarze 72: .It Fl f
73: A synonym for
74: .Xr whatis 1 .
75: This overrides any earlier
76: .Fl k
77: and
78: .Fl l
79: options.
1.101 schwarze 80: .Sm off
81: .It Fl I Cm os Li = Ar name
82: .Sm on
83: Override the default operating system
84: .Ar name
85: for the
86: .Xr mdoc 7
87: .Sq \&Os
1.130 schwarze 88: and for the
89: .Xr man 7
90: .Sq \&TH
1.101 schwarze 91: macro.
1.110 schwarze 92: .It Fl h
93: Display only the SYNOPSIS lines.
94: Implies
1.122 schwarze 95: .Fl c .
1.119 schwarze 96: .It Fl K Ns Ar encoding
97: Specify the input encoding.
98: The supported
99: .Ar encoding
100: arguments are
101: .Cm us-ascii ,
102: .Cm iso-8859-1 ,
103: and
104: .Cm utf-8 .
105: If not specified, autodetection uses the first match:
106: .Bl -tag -width iso-8859-1
107: .It Cm utf-8
108: if the first three bytes of the input file
109: are the UTF-8 byte order mark (BOM, 0xefbbbf)
110: .It Ar encoding
111: if the first or second line of the input file matches the
112: .Sy emacs
113: mode line format
114: .Pp
115: .D1 .\e" -*- Oo ...; Oc coding: Ar encoding ; No -*-
116: .It Cm utf-8
117: if the first non-ASCII byte in the file introduces a valid UTF-8 sequence
118: .It Cm iso-8859-1
119: otherwise
120: .El
1.109 schwarze 121: .It Fl k
122: A synonym for
123: .Xr apropos 1 .
124: This overrides any earlier
125: .Fl f
126: and
127: .Fl l
128: options.
129: .It Fl l
130: A synonym for
131: .Fl a .
132: Also reverts any earlier
133: .Fl f
134: and
135: .Fl k
136: options.
1.19 kristaps 137: .It Fl m Ns Ar format
1.57 kristaps 138: Input format.
139: See
1.8 kristaps 140: .Sx Input Formats
1.57 kristaps 141: for available formats.
142: Defaults to
1.58 kristaps 143: .Fl m Ns Cm andoc .
144: .It Fl O Ns Ar option
1.57 kristaps 145: Comma-separated output options.
1.19 kristaps 146: .It Fl T Ns Ar output
1.57 kristaps 147: Output format.
148: See
1.1 kristaps 149: .Sx Output Formats
1.57 kristaps 150: for available formats.
151: Defaults to
1.128 schwarze 152: .Fl T Ns Cm locale .
1.1 kristaps 153: .It Fl V
154: Print version and exit.
1.77 schwarze 155: .It Fl W Ns Ar level
156: Specify the minimum message
157: .Ar level
158: to be reported on the standard error output and to affect the exit status.
159: The
160: .Ar level
161: can be
1.133 schwarze 162: .Cm warning ,
163: .Cm error ,
1.77 schwarze 164: or
1.133 schwarze 165: .Cm unsupp ;
1.132 schwarze 166: .Cm all
1.77 schwarze 167: is an alias for
1.132 schwarze 168: .Cm warning .
169: By default,
170: .Nm
171: is silent.
1.77 schwarze 172: See
173: .Sx EXIT STATUS
174: and
175: .Sx DIAGNOSTICS
176: for details.
177: .Pp
178: The special option
179: .Fl W Ns Cm stop
180: tells
181: .Nm
182: to exit after parsing a file that causes warnings or errors of at least
183: the requested level.
184: No formatted output will be produced from that file.
185: If both a
186: .Ar level
187: and
188: .Cm stop
189: are requested, they can be joined with a comma, for example
190: .Fl W Ns Cm error , Ns Cm stop .
1.58 kristaps 191: .It Ar file
192: Read input from zero or more files.
1.57 kristaps 193: If unspecified, reads from stdin.
194: If multiple files are specified,
1.2 kristaps 195: .Nm
196: will halt with the first failed parse.
1.1 kristaps 197: .El
1.109 schwarze 198: .Pp
199: In
200: .Fl f
201: and
202: .Fl k
203: mode,
204: .Nm
205: also supports the options
206: .Fl CMmOSsw
207: described in the
208: .Xr apropos 1
209: manual.
1.8 kristaps 210: .Ss Input Formats
211: The
212: .Nm
213: utility accepts
214: .Xr mdoc 7
215: and
216: .Xr man 7
217: input with
1.58 kristaps 218: .Fl m Ns Cm doc
1.8 kristaps 219: and
1.58 kristaps 220: .Fl m Ns Cm an ,
1.57 kristaps 221: respectively.
222: The
1.8 kristaps 223: .Xr mdoc 7
224: format is
225: .Em strongly
1.26 kristaps 226: recommended;
1.8 kristaps 227: .Xr man 7
228: should only be used for legacy manuals.
1.11 kristaps 229: .Pp
1.12 kristaps 230: A third option,
1.58 kristaps 231: .Fl m Ns Cm andoc ,
1.13 kristaps 232: which is also the default, determines encoding on-the-fly: if the first
1.26 kristaps 233: non-comment macro is
1.27 kristaps 234: .Sq \&Dd
1.13 kristaps 235: or
1.27 kristaps 236: .Sq \&Dt ,
1.26 kristaps 237: the
1.13 kristaps 238: .Xr mdoc 7
239: parser is used; otherwise, the
240: .Xr man 7
241: parser is used.
242: .Pp
243: If multiple
1.26 kristaps 244: files are specified with
1.58 kristaps 245: .Fl m Ns Cm andoc ,
1.57 kristaps 246: each has its file-type determined this way.
247: If multiple files are
1.13 kristaps 248: specified and
1.58 kristaps 249: .Fl m Ns Cm doc
1.12 kristaps 250: or
1.58 kristaps 251: .Fl m Ns Cm an
1.12 kristaps 252: is specified, then this format is used exclusively.
1.1 kristaps 253: .Ss Output Formats
254: The
255: .Nm
256: utility accepts the following
257: .Fl T
1.66 kristaps 258: arguments, which correspond to output modes:
1.93 schwarze 259: .Bl -tag -width "-Tlocale"
1.58 kristaps 260: .It Fl T Ns Cm ascii
1.81 kristaps 261: Produce 7-bit ASCII output.
1.57 kristaps 262: See
1.48 kristaps 263: .Sx ASCII Output .
1.58 kristaps 264: .It Fl T Ns Cm html
1.116 kristaps 265: Produce HTML5, CSS1, and MathML output.
1.57 kristaps 266: See
1.48 kristaps 267: .Sx HTML Output .
1.58 kristaps 268: .It Fl T Ns Cm lint
269: Parse only: produce no output.
270: Implies
1.77 schwarze 271: .Fl W Ns Cm warning .
1.93 schwarze 272: .It Fl T Ns Cm locale
273: Encode output using the current locale.
1.128 schwarze 274: This is the default.
1.93 schwarze 275: See
276: .Sx Locale Output .
1.91 schwarze 277: .It Fl T Ns Cm man
1.95 kristaps 278: Produce
1.91 schwarze 279: .Xr man 7
1.95 kristaps 280: format output.
281: See
282: .Sx Man Output .
1.73 kristaps 283: .It Fl T Ns Cm pdf
284: Produce PDF output.
285: See
286: .Sx PDF Output .
1.62 kristaps 287: .It Fl T Ns Cm ps
288: Produce PostScript output.
289: See
290: .Sx PostScript Output .
1.58 kristaps 291: .It Fl T Ns Cm tree
292: Produce an indented parse tree.
1.93 schwarze 293: .It Fl T Ns Cm utf8
294: Encode output in the UTF\-8 multi-byte format.
295: See
296: .Sx UTF\-8 Output .
1.58 kristaps 297: .It Fl T Ns Cm xhtml
1.114 kristaps 298: This is a synonym for
299: .Fl T Ns Cm html .
1.1 kristaps 300: .El
1.13 kristaps 301: .Pp
302: If multiple input files are specified, these will be processed by the
303: corresponding filter in-order.
1.66 kristaps 304: .Ss ASCII Output
305: Output produced by
1.128 schwarze 306: .Fl T Ns Cm ascii
307: is rendered in standard 7-bit ASCII documented in
1.66 kristaps 308: .Xr ascii 7 .
309: .Pp
310: Font styles are applied by using back-spaced encoding such that an
311: underlined character
312: .Sq c
313: is rendered as
314: .Sq _ Ns \e[bs] Ns c ,
315: where
316: .Sq \e[bs]
317: is the back-space character number 8.
318: Emboldened characters are rendered as
319: .Sq c Ns \e[bs] Ns c .
320: .Pp
321: The special characters documented in
322: .Xr mandoc_char 7
323: are rendered best-effort in an ASCII equivalent.
1.87 kristaps 324: If no equivalent is found,
325: .Sq \&?
326: is used instead.
1.66 kristaps 327: .Pp
328: Output width is limited to 78 visible columns unless literal input lines
329: exceed this limit.
330: .Pp
331: The following
332: .Fl O
333: arguments are accepted:
1.19 kristaps 334: .Bl -tag -width Ds
1.98 schwarze 335: .It Cm indent Ns = Ns Ar indent
336: The left margin for normal text is set to
337: .Ar indent
338: blank characters instead of the default of five for
339: .Xr mdoc 7
340: and seven for
341: .Xr man 7 .
342: Increasing this is not recommended; it may result in degraded formatting,
1.99 schwarze 343: for example overfull lines or ugly line breaks.
1.66 kristaps 344: .It Cm width Ns = Ns Ar width
345: The output width is set to
346: .Ar width ,
347: which will normalise to \(>=60.
1.1 kristaps 348: .El
1.66 kristaps 349: .Ss HTML Output
350: Output produced by
351: .Fl T Ns Cm html
1.114 kristaps 352: conforms to HTML5 using optional self-closing tags.
1.116 kristaps 353: Default styles use only CSS1.
354: Equations rendered from
355: .Xr eqn 7
356: blocks use MathML.
1.66 kristaps 357: .Pp
1.61 kristaps 358: The
1.66 kristaps 359: .Pa example.style.css
1.83 kristaps 360: file documents style-sheet classes available for customising output.
361: If a style-sheet is not specified with
362: .Fl O Ns Ar style ,
363: .Fl T Ns Cm html
1.114 kristaps 364: defaults to simple output (via an embedded style-sheet)
365: readable in any graphical or text-based web
1.83 kristaps 366: browser.
1.66 kristaps 367: .Pp
1.89 kristaps 368: Special characters are rendered in decimal-encoded UTF\-8.
1.66 kristaps 369: .Pp
370: The following
1.64 kristaps 371: .Fl O
1.66 kristaps 372: arguments are accepted:
1.37 kristaps 373: .Bl -tag -width Ds
1.94 kristaps 374: .It Cm fragment
1.123 schwarze 375: Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
376: elements and only emit the subtree below the <body> element.
1.94 kristaps 377: The
378: .Cm style
1.97 schwarze 379: argument will be ignored.
1.94 kristaps 380: This is useful when embedding manual content within existing documents.
1.64 kristaps 381: .It Cm includes Ns = Ns Ar fmt
1.40 kristaps 382: The string
383: .Ar fmt ,
1.49 kristaps 384: for example,
1.40 kristaps 385: .Ar ../src/%I.html ,
386: is used as a template for linked header files (usually via the
387: .Sq \&In
1.57 kristaps 388: macro).
389: Instances of
1.43 kristaps 390: .Sq \&%I
1.57 kristaps 391: are replaced with the include filename.
392: The default is not to present a
1.40 kristaps 393: hyperlink.
1.64 kristaps 394: .It Cm man Ns = Ns Ar fmt
1.39 kristaps 395: The string
396: .Ar fmt ,
1.49 kristaps 397: for example,
1.39 kristaps 398: .Ar ../html%S/%N.%S.html ,
399: is used as a template for linked manuals (usually via the
1.37 kristaps 400: .Sq \&Xr
1.57 kristaps 401: macro).
402: Instances of
1.43 kristaps 403: .Sq \&%N
1.40 kristaps 404: and
405: .Sq %S
406: are replaced with the linked manual's name and section, respectively.
1.57 kristaps 407: If no section is included, section 1 is assumed.
408: The default is not to
1.40 kristaps 409: present a hyperlink.
1.64 kristaps 410: .It Cm style Ns = Ns Ar style.css
1.58 kristaps 411: The file
412: .Ar style.css
413: is used for an external style-sheet.
414: This must be a valid absolute or
415: relative URI.
1.61 kristaps 416: .El
1.93 schwarze 417: .Ss Locale Output
418: Locale-depending output encoding is triggered with
419: .Fl T Ns Cm locale .
1.128 schwarze 420: This is the default.
421: .Pp
1.93 schwarze 422: This option is not available on all systems: systems without locale
423: support, or those whose internal representation is not natively UCS-4,
424: will fall back to
425: .Fl T Ns Cm ascii .
426: See
427: .Sx ASCII Output
428: for font style specification and available command-line arguments.
1.95 kristaps 429: .Ss Man Output
430: Translate input format into
431: .Xr man 7
432: output format.
1.102 schwarze 433: This is useful for distributing manual sources to legacy systems
1.96 kristaps 434: lacking
1.95 kristaps 435: .Xr mdoc 7
436: formatters.
437: .Pp
438: If
439: .Xr mdoc 7
440: is passed as input, it is translated into
1.97 schwarze 441: .Xr man 7 .
442: If the input format is
1.95 kristaps 443: .Xr man 7 ,
1.97 schwarze 444: the input is copied to the output, expanding any
1.95 kristaps 445: .Xr roff 7
446: .Sq so
1.97 schwarze 447: requests.
448: The parser is also run, and as usual, the
449: .Fl W
450: level controls which
451: .Sx DIAGNOSTICS
452: are displayed before copying the input to the output.
1.93 schwarze 453: .Ss PDF Output
454: PDF-1.1 output may be generated by
455: .Fl T Ns Cm pdf .
456: See
457: .Sx PostScript Output
458: for
459: .Fl O
460: arguments and defaults.
1.62 kristaps 461: .Ss PostScript Output
1.65 kristaps 462: PostScript
463: .Qq Adobe-3.0
464: Level-2 pages may be generated by
1.62 kristaps 465: .Fl T Ns Cm ps .
1.67 kristaps 466: Output pages default to letter sized and are rendered in the Times font
1.70 kristaps 467: family, 11-point.
468: Margins are calculated as 1/9 the page length and width.
1.71 kristaps 469: Line-height is 1.4m.
1.66 kristaps 470: .Pp
471: Special characters are rendered as in
472: .Sx ASCII Output .
473: .Pp
474: The following
475: .Fl O
476: arguments are accepted:
477: .Bl -tag -width Ds
478: .It Cm paper Ns = Ns Ar name
479: The paper size
480: .Ar name
481: may be one of
1.68 kristaps 482: .Ar a3 ,
483: .Ar a4 ,
484: .Ar a5 ,
485: .Ar legal ,
1.66 kristaps 486: or
487: .Ar letter .
1.68 kristaps 488: You may also manually specify dimensions as
489: .Ar NNxNN ,
490: width by height in millimetres.
491: If an unknown value is encountered,
492: .Ar letter
493: is used.
1.66 kristaps 494: .El
1.93 schwarze 495: .Ss UTF\-8 Output
496: Use
497: .Fl T Ns Cm utf8
498: to force a UTF\-8 locale.
1.73 kristaps 499: See
1.93 schwarze 500: .Sx Locale Output
501: for details and options.
1.108 schwarze 502: .Sh ENVIRONMENT
503: .Bl -tag -width MANPAGER
504: .It Ev MANPAGER
505: Any non-empty value of the environment variable
506: .Ev MANPAGER
507: will be used instead of the standard pagination program,
508: .Xr more 1 .
509: .It Ev PAGER
510: Specifies the pagination program to use when
511: .Ev MANPAGER
512: is not defined.
513: If neither PAGER nor MANPAGER is defined,
514: .Pa /usr/bin/more Fl s
515: will be used.
516: .El
1.77 schwarze 517: .Sh EXIT STATUS
518: The
519: .Nm
520: utility exits with one of the following values, controlled by the message
521: .Ar level
522: associated with the
523: .Fl W
524: option:
525: .Pp
526: .Bl -tag -width Ds -compact
527: .It 0
528: No warnings or errors occurred, or those that did were ignored because
529: they were lower than the requested
530: .Ar level .
531: .It 2
532: At least one warning occurred, but no error, and
533: .Fl W Ns Cm warning
534: was specified.
535: .It 3
1.133 schwarze 536: At least one parsing error occurred,
537: but no unsupported feature was encountered, and
538: .Fl W Ns Cm error
539: or
540: .Fl W Ns Cm warning
541: was specified.
542: .It 4
1.134 schwarze 543: At least one unsupported feature was encountered, and
1.133 schwarze 544: .Fl W Ns Cm unsupp ,
1.77 schwarze 545: .Fl W Ns Cm error
546: or
547: .Fl W Ns Cm warning
548: was specified.
549: .It 5
550: Invalid command line arguments were specified.
551: No input files have been read.
552: .It 6
1.131 schwarze 553: An operating system error occurred, for example exhaustion
554: of memory, file descriptors, or process table entries.
1.77 schwarze 555: Such errors cause
556: .Nm
557: to exit at once, possibly in the middle of parsing or formatting a file.
558: .El
559: .Pp
560: Note that selecting
561: .Fl T Ns Cm lint
562: output mode implies
563: .Fl W Ns Cm warning .
1.1 kristaps 564: .Sh EXAMPLES
1.13 kristaps 565: To page manuals to the terminal:
1.1 kristaps 566: .Pp
1.82 kristaps 567: .Dl $ mandoc \-Wall,stop mandoc.1 2\*(Gt&1 | less
568: .Dl $ mandoc mandoc.1 mdoc.3 mdoc.7 | less
1.28 kristaps 569: .Pp
1.41 kristaps 570: To produce HTML manuals with
571: .Ar style.css
572: as the style-sheet:
1.38 kristaps 573: .Pp
1.82 kristaps 574: .Dl $ mandoc \-Thtml -Ostyle=style.css mdoc.7 \*(Gt mdoc.7.html
1.38 kristaps 575: .Pp
1.28 kristaps 576: To check over a large set of manuals:
577: .Pp
1.77 schwarze 578: .Dl $ mandoc \-Tlint `find /usr/src -name \e*\e.[1-9]`
1.66 kristaps 579: .Pp
580: To produce a series of PostScript manuals for A4 paper:
581: .Pp
1.82 kristaps 582: .Dl $ mandoc \-Tps \-Opaper=a4 mdoc.7 man.7 \*(Gt manuals.ps
1.91 schwarze 583: .Pp
584: Convert a modern
585: .Xr mdoc 7
586: manual to the older
587: .Xr man 7
588: format, for use on systems lacking an
589: .Xr mdoc 7
590: parser:
591: .Pp
592: .Dl $ mandoc \-Tman foo.mdoc \*(Gt foo.man
1.77 schwarze 593: .Sh DIAGNOSTICS
1.106 schwarze 594: Messages displayed by
595: .Nm
596: follow this format:
1.77 schwarze 597: .Pp
1.106 schwarze 598: .D1 Nm Ns : Ar file : Ns Ar line : Ns Ar column : level : message : macro args
1.77 schwarze 599: .Pp
1.106 schwarze 600: Line and column numbers start at 1.
601: Both are omitted for messages referring to an input file as a whole.
602: Macro names and arguments are omitted where meaningless.
603: Fatal messages about invalid command line arguments
604: or operating system errors, for example when memory is exhausted,
605: may also omit the
606: .Ar file
1.104 schwarze 607: and
1.106 schwarze 608: .Ar level
609: fields.
1.104 schwarze 610: .Pp
1.77 schwarze 611: Message levels have the following meanings:
612: .Bl -tag -width "warning"
1.133 schwarze 613: .It Cm unsupp
614: An input file uses unsupported low-level
615: .Xr roff 7
616: features.
617: The output may be incomplete and/or misformatted,
618: so using GNU troff instead of
619: .Nm
620: to process the file may be preferable.
1.77 schwarze 621: .It Cm error
1.133 schwarze 622: An input file contains invalid syntax that cannot be safely interpreted.
1.77 schwarze 623: By discarding part of the input or inserting missing tokens,
624: the parser is able to continue, and the error does not prevent
625: generation of formatted output, but typically, preparing that
626: output involves information loss, broken document structure
1.133 schwarze 627: or unintended formatting, no matter whether
628: .Nm
629: or GNU troff is used.
630: In many cases, the output of
631: .Nm
632: and GNU troff is identical, but in some,
633: .Nm
634: is more resilient than GNU troff with respect to malformed input.
1.131 schwarze 635: .Pp
636: Non-existent or unreadable input files are also reported on the
637: .Cm error
638: level.
639: In that case, the parser cannot even be started and no output
640: is produced from those input files.
1.77 schwarze 641: .It Cm warning
642: An input file uses obsolete, discouraged or non-portable syntax.
643: All the same, the meaning of the input is unambiguous and a correct
644: rendering can be produced.
645: Documents causing warnings may render poorly when using other
646: formatting tools instead of
647: .Nm .
648: .El
649: .Pp
650: Messages of the
1.133 schwarze 651: .Cm warning ,
652: .Cm error ,
1.77 schwarze 653: and
1.133 schwarze 654: .Cm unsupp
1.131 schwarze 655: levels except those about non-existent or unreadable input files
656: are hidden unless their level, or a lower level, is requested using a
1.77 schwarze 657: .Fl W
658: option or
659: .Fl T Ns Cm lint
660: output mode.
1.106 schwarze 661: .Ss Warnings related to the document prologue
662: .Bl -ohang
663: .It Sy "missing manual title, using UNTITLED"
664: .Pq mdoc
665: A
666: .Ic \&Dt
667: macro has no arguments, or there is no
668: .Ic \&Dt
669: macro before the first non-prologue macro.
670: .It Sy "missing manual title, using \(dq\(dq"
671: .Pq man
672: There is no
673: .Ic \&TH
674: macro, or it has no arguments.
675: .It Sy "lower case character in document title"
676: .Pq mdoc , man
677: The title is still used as given in the
678: .Ic \&Dt
679: or
680: .Ic \&TH
681: macro.
682: .It Sy "missing manual section, using \(dq\(dq"
683: .Pq mdoc , man
684: A
685: .Ic \&Dt
686: or
687: .Ic \&TH
688: macro lacks the mandatory section argument.
689: .It Sy "unknown manual section"
690: .Pq mdoc
691: The section number in a
692: .Ic \&Dt
693: line is invalid, but still used.
694: .It Sy "missing date, using today's date"
695: .Pq mdoc, man
696: The document was parsed as
697: .Xr mdoc 7
698: and it has no
699: .Ic \&Dd
700: macro, or the
701: .Ic \&Dd
702: macro has no arguments or only empty arguments;
703: or the document was parsed as
704: .Xr man 7
705: and it has no
706: .Ic \&TH
707: macro, or the
708: .Ic \&TH
709: macro has less than three arguments or its third argument is empty.
710: .It Sy "cannot parse date, using it verbatim"
711: .Pq mdoc , man
712: The date given in a
713: .Ic \&Dd
714: or
715: .Ic \&TH
716: macro does not follow the conventional format.
717: .It Sy "missing Os macro, using \(dq\(dq"
718: .Pq mdoc
719: The default or current system is not shown in this case.
720: .It Sy "duplicate prologue macro"
721: .Pq mdoc
722: One of the prologue macros occurs more than once.
723: The last instance overrides all previous ones.
724: .It Sy "late prologue macro"
725: .Pq mdoc
726: A
727: .Ic \&Dd
728: or
729: .Ic \&Os
730: macro occurs after some non-prologue macro, but still takes effect.
731: .It Sy "skipping late title macro"
732: .Pq mdoc
733: The
734: .Ic \&Dt
735: macro can only occur before the first non-prologue macro
736: because traditional formatters write the page header
737: before parsing the document body.
738: Even though this technical restriction does not apply to
739: .Nm ,
740: traditional semantics is preserved.
741: The late macro is discarded including its arguments.
742: .It Sy "prologue macros out of order"
743: .Pq mdoc
744: The prologue macros are not given in the conventional order
745: .Ic \&Dd ,
746: .Ic \&Dt ,
747: .Ic \&Os .
748: All three macros are used even when given in another order.
749: .El
750: .Ss Warnings regarding document structure
751: .Bl -ohang
752: .It Sy ".so is fragile, better use ln(1)"
753: .Pq roff
754: Including files only works when the parser program runs with the correct
755: current working directory.
756: .It Sy "no document body"
757: .Pq mdoc , man
758: The document body contains neither text nor macros.
759: An empty document is shown, consisting only of a header and a footer line.
760: .It Sy "content before first section header"
761: .Pq mdoc , man
762: Some macros or text precede the first
763: .Ic \&Sh
764: or
765: .Ic \&SH
766: section header.
767: The offending macros and text are parsed and added to the top level
768: of the syntax tree, outside any section block.
769: .It Sy "first section is not NAME"
770: .Pq mdoc
771: The argument of the first
772: .Ic \&Sh
773: macro is not
774: .Sq NAME .
775: This may confuse
776: .Xr makewhatis 8
777: and
778: .Xr apropos 1 .
779: .It Sy "bad NAME section contents"
780: .Pq mdoc
781: The last node in the NAME section is not an
782: .Ic \&Nd
783: macro, or any preceding macro is not
784: .Ic \&Nm ,
785: or the NAME section is completely empty.
786: This may confuse
787: .Xr makewhatis 8
788: and
789: .Xr apropos 1 .
790: .It Sy "sections out of conventional order"
791: .Pq mdoc
792: A standard section occurs after another section it usually precedes.
793: All section titles are used as given,
794: and the order of sections is not changed.
795: .It Sy "duplicate section title"
796: .Pq mdoc
797: The same standard section title occurs more than once.
798: .It Sy "unexpected section"
799: .Pq mdoc
800: A standard section header occurs in a section of the manual
801: where it normally isn't useful.
1.112 schwarze 802: .It Sy "unusual Xr order"
803: .Pq mdoc
804: In the SEE ALSO section, an
805: .Ic \&Xr
806: macro with a lower section number follows one with a higher number,
807: or two
808: .Ic \&Xr
809: macros refering to the same section are out of alphabetical order.
810: .It Sy "unusual Xr punctuation"
811: .Pq mdoc
812: In the SEE ALSO section, punctuation between two
813: .Ic \&Xr
814: macros differs from a single comma, or there is trailing punctuation
815: after the last
816: .Ic \&Xr
817: macro.
1.111 schwarze 818: .It Sy "AUTHORS section without An macro"
819: .Pq mdoc
820: An AUTHORS sections contains no
821: .Ic \&An
822: macros, or only empty ones.
823: Probably, there are author names lacking markup.
1.106 schwarze 824: .El
825: .Ss "Warnings related to macros and nesting"
826: .Bl -ohang
827: .It Sy "obsolete macro"
828: .Pq mdoc
829: See the
830: .Xr mdoc 7
831: manual for replacements.
1.126 schwarze 832: .It Sy "macro neither callable nor escaped"
833: .Pq mdoc
834: The name of a macro that is not callable appears on a macro line.
835: It is printed verbatim.
836: If the intention is to call it, move it to its own line;
837: otherwise, escape it by prepending
838: .Sq \e& .
1.106 schwarze 839: .It Sy "skipping paragraph macro"
840: In
841: .Xr mdoc 7
842: documents, this happens
843: .Bl -dash -compact
844: .It
845: at the beginning and end of sections and subsections
846: .It
847: right before non-compact lists and displays
848: .It
849: at the end of items in non-column, non-compact lists
850: .It
851: and for multiple consecutive paragraph macros.
852: .El
853: In
854: .Xr man 7
855: documents, it happens
856: .Bl -dash -compact
857: .It
858: for empty
859: .Ic \&P ,
860: .Ic \&PP ,
861: and
862: .Ic \&LP
863: macros
864: .It
865: for
866: .Ic \&IP
867: macros having neither head nor body arguments
868: .It
869: for
870: .Ic \&br
871: or
872: .Ic \&sp
873: right after
874: .Ic \&SH
875: or
876: .Ic \&SS
877: .El
878: .It Sy "moving paragraph macro out of list"
879: .Pq mdoc
880: A list item in a
881: .Ic \&Bl
882: list contains a trailing paragraph macro.
883: The paragraph macro is moved after the end of the list.
884: .It Sy "skipping no-space macro"
885: .Pq mdoc
886: An input line begins with an
887: .Ic \&Ns
888: macro.
889: The macro is ignored.
890: .It Sy "blocks badly nested"
891: .Pq mdoc
892: If two blocks intersect, one should completely contain the other.
893: Otherwise, rendered output is likely to look strange in any output
894: format, and rendering in SGML-based output formats is likely to be
895: outright wrong because such languages do not support badly nested
896: blocks at all.
897: Typical examples of badly nested blocks are
898: .Qq Ic \&Ao \&Bo \&Ac \&Bc
899: and
900: .Qq Ic \&Ao \&Bq \&Ac .
901: In these examples,
902: .Ic \&Ac
903: breaks
904: .Ic \&Bo
905: and
906: .Ic \&Bq ,
907: respectively.
908: .It Sy "nested displays are not portable"
909: .Pq mdoc
910: A
911: .Ic \&Bd ,
912: .Ic \&D1 ,
913: or
914: .Ic \&Dl
915: display occurs nested inside another
916: .Ic \&Bd
917: display.
918: This works with
919: .Nm ,
920: but fails with most other implementations.
921: .It Sy "moving content out of list"
922: .Pq mdoc
923: A
924: .Ic \&Bl
925: list block contains text or macros before the first
926: .Ic \&It
927: macro.
928: The offending children are moved before the beginning of the list.
929: .It Sy ".Vt block has child macro"
930: .Pq mdoc
931: The
932: .Ic \&Vt
933: macro supports plain text arguments only.
934: Formatting may be ugly and semantic searching
935: for the affected content might not work.
936: .It Sy "fill mode already enabled, skipping"
937: .Pq man
938: A
939: .Ic \&fi
940: request occurs even though the document is still in fill mode,
941: or already switched back to fill mode.
942: It has no effect.
943: .It Sy "fill mode already disabled, skipping"
944: .Pq man
945: An
946: .Ic \&nf
947: request occurs even though the document already switched to no-fill mode
948: and did not switch back to fill mode yet.
949: It has no effect.
950: .It Sy "line scope broken"
951: .Pq man
952: While parsing the next-line scope of the previous macro,
953: another macro is found that prematurely terminates the previous one.
954: The previous, interrupted macro is deleted from the parse tree.
955: .El
956: .Ss "Warnings related to missing arguments"
957: .Bl -ohang
958: .It Sy "skipping empty request"
1.118 schwarze 959: .Pq roff , eqn
960: The macro name is missing from a macro definition request,
961: or an
962: .Xr eqn 7
963: control statement or operation keyword lacks its required argument.
1.106 schwarze 964: .It Sy "conditional request controls empty scope"
965: .Pq roff
966: A conditional request is only useful if any of the following
967: follows it on the same logical input line:
968: .Bl -dash -compact
969: .It
970: The
971: .Sq \e{
972: keyword to open a multi-line scope.
973: .It
974: A request or macro or some text, resulting in a single-line scope.
975: .It
976: The immediate end of the logical line without any intervening whitespace,
977: resulting in next-line scope.
978: .El
979: Here, a conditional request is followed by trailing whitespace only,
980: and there is no other content on its logical input line.
981: Note that it doesn't matter whether the logical input line is split
982: across multiple physical input lines using
983: .Sq \e
984: line continuation characters.
985: This is one of the rare cases
986: where trailing whitespace is syntactically significant.
987: The conditional request controls a scope containing whitespace only,
988: so it is unlikely to have a significant effect,
989: except that it may control a following
990: .Ic \&el
991: clause.
992: .It Sy "skipping empty macro"
993: .Pq mdoc
994: The indicated macro has no arguments and hence no effect.
995: .It Sy "empty argument, using 0n"
996: .Pq mdoc
997: The required width is missing after
998: .Ic \&Bd
999: or
1000: .Ic \&Bl
1001: .Fl offset
1002: or
1003: .Fl width.
1004: .It Sy "argument count wrong"
1005: .Pq mdoc , man
1006: The indicated macro has too few or too many arguments.
1007: The syntax tree will contain the wrong number of arguments as given.
1008: Formatting behaviour depends on the specific macro in question.
1009: Note that the same message may also occur as an ERROR, see below.
1010: .It Sy "missing display type, using -ragged"
1011: .Pq mdoc
1012: The
1013: .Ic \&Bd
1014: macro is invoked without the required display type.
1015: .It Sy "list type is not the first argument"
1016: .Pq mdoc
1017: In a
1018: .Ic \&Bl
1019: macro, at least one other argument precedes the type argument.
1020: The
1021: .Nm
1022: utility copes with any argument order, but some other
1023: .Xr mdoc 7
1024: implementations do not.
1025: .It Sy "missing -width in -tag list, using 8n"
1026: .Pq mdoc
1027: Every
1028: .Ic \&Bl
1029: macro having the
1030: .Fl tag
1031: argument requires
1032: .Fl width ,
1033: too.
1034: .It Sy "missing utility name, using \(dq\(dq"
1035: .Pq mdoc
1036: The
1037: .Ic \&Ex Fl std
1038: macro is called without an argument before
1039: .Ic \&Nm
1040: has first been called with an argument.
1041: .It Sy "empty head in list item"
1042: .Pq mdoc
1043: In a
1044: .Ic \&Bl
1045: .Fl diag ,
1046: .Fl hang ,
1047: .Fl inset ,
1048: .Fl ohang ,
1049: or
1050: .Fl tag
1051: list, an
1052: .Ic \&It
1053: macro lacks the required argument.
1054: The item head is left empty.
1055: .It Sy "empty list item"
1056: .Pq mdoc
1057: In a
1058: .Ic \&Bl
1059: .Fl bullet ,
1060: .Fl dash ,
1061: .Fl enum ,
1062: or
1063: .Fl hyphen
1064: list, an
1065: .Ic \&It
1066: block is empty.
1067: An empty list item is shown.
1068: .It Sy "missing font type"
1069: .Pq mdoc
1070: A
1071: .Ic \&Bf
1072: macro has no argument.
1073: It switches to the default font,
1074: .Cm \efR .
1075: .It Sy "unknown font type"
1076: .Pq mdoc
1077: The
1078: .Ic \&Bf
1079: argument is invalid.
1080: The default font
1081: .Cm \efR
1082: is used instead.
1.127 schwarze 1083: .It Sy "nothing follows prefix"
1084: .Pq mdoc
1085: A
1086: .Ic \&Pf
1087: macro has no argument, or only one argument and no macro follows
1088: on the same input line.
1089: This defeats its purpose; in particular, spacing is not suppressed
1090: before the text or macros following on the next input line.
1.106 schwarze 1091: .It Sy "missing -std argument, adding it"
1092: .Pq mdoc
1093: An
1094: .Ic \&Ex
1095: or
1096: .Ic \&Rv
1097: macro lacks the required
1098: .Fl std
1099: argument.
1100: The
1101: .Nm
1102: utility assumes
1103: .Fl std
1104: even when it is not specified, but other implementations may not.
1.118 schwarze 1105: .It Sy "missing eqn box, using \(dq\(dq"
1106: .Pq eqn
1107: A diacritic mark or a binary operator is found,
1108: but there is nothing to the left of it.
1109: An empty box is inserted.
1.106 schwarze 1110: .El
1111: .Ss "Warnings related to bad macro arguments"
1112: .Bl -ohang
1113: .It Sy "unterminated quoted argument"
1114: .Pq roff
1115: Macro arguments can be enclosed in double quote characters
1116: such that space characters and macro names contained in the quoted
1117: argument need not be escaped.
1118: The closing quote of the last argument of a macro can be omitted.
1119: However, omitting it is not recommended because it makes the code
1120: harder to read.
1121: .It Sy "duplicate argument"
1122: .Pq mdoc
1123: A
1124: .Ic \&Bd
1125: or
1126: .Ic \&Bl
1127: macro has more than one
1128: .Fl compact ,
1129: more than one
1130: .Fl offset ,
1131: or more than one
1132: .Fl width
1133: argument.
1134: All but the last instances of these arguments are ignored.
1135: .It Sy "skipping duplicate argument"
1136: .Pq mdoc
1137: An
1138: .Ic \&An
1139: macro has more than one
1140: .Fl split
1141: or
1142: .Fl nosplit
1143: argument.
1144: All but the first of these arguments are ignored.
1145: .It Sy "skipping duplicate display type"
1146: .Pq mdoc
1147: A
1148: .Ic \&Bd
1149: macro has more than one type argument; the first one is used.
1150: .It Sy "skipping duplicate list type"
1151: .Pq mdoc
1152: A
1153: .Ic \&Bl
1154: macro has more than one type argument; the first one is used.
1155: .It Sy "skipping -width argument"
1156: .Pq mdoc
1157: A
1158: .Ic \&Bl
1159: .Fl column ,
1160: .Fl diag ,
1161: .Fl ohang ,
1162: .Fl inset ,
1163: or
1164: .Fl item
1165: list has a
1166: .Fl width
1167: argument.
1168: That has no effect.
1169: .It Sy "unknown AT&T UNIX version"
1170: .Pq mdoc
1171: An
1172: .Ic \&At
1173: macro has an invalid argument.
1174: It is used verbatim, with
1175: .Qq "AT&T UNIX "
1176: prefixed to it.
1.113 schwarze 1177: .It Sy "comma in function argument"
1178: .Pq mdoc
1179: An argument of an
1180: .Ic \&Fa
1181: or
1182: .Ic \&Fn
1183: macro contains a comma; it should probably be split into two arguments.
1.117 schwarze 1184: .It Sy "parenthesis in function name"
1185: .Pq mdoc
1186: The first argument of an
1187: .Ic \&Fc
1188: or
1189: .Ic \&Fn
1190: macro contains an opening or closing parenthesis; that's probably wrong,
1191: parentheses are added automatically.
1.106 schwarze 1192: .It Sy "invalid content in Rs block"
1193: .Pq mdoc
1194: An
1195: .Ic \&Rs
1196: block contains plain text or non-% macros.
1197: The bogus content is left in the syntax tree.
1198: Formatting may be poor.
1199: .It Sy "invalid Boolean argument"
1200: .Pq mdoc
1201: An
1202: .Ic \&Sm
1203: macro has an argument other than
1204: .Cm on
1205: or
1206: .Cm off .
1207: The invalid argument is moved out of the macro, which leaves the macro
1208: empty, causing it to toggle the spacing mode.
1209: .It Sy "unknown font, skipping request"
1.115 schwarze 1210: .Pq man , tbl
1.106 schwarze 1211: A
1212: .Xr roff 7
1213: .Ic \&ft
1.115 schwarze 1214: request or a
1215: .Xr tbl 7
1216: .Ic \&f
1217: layout modifier has an unknown
1218: .Ar font
1219: argument.
1.106 schwarze 1220: .El
1221: .Ss "Warnings related to plain text"
1222: .Bl -ohang
1223: .It Sy "blank line in fill mode, using .sp"
1224: .Pq mdoc
1225: The meaning of blank input lines is only well-defined in non-fill mode:
1226: In fill mode, line breaks of text input lines are not supposed to be
1227: significant.
1228: However, for compatibility with groff, blank lines in fill mode
1229: are replaced with
1230: .Ic \&sp
1231: requests.
1232: .It Sy "tab in filled text"
1233: .Pq mdoc , man
1234: The meaning of tab characters is only well-defined in non-fill mode:
1235: In fill mode, whitespace is not supposed to be significant
1236: on text input lines.
1237: As an implementation dependent choice, tab characters on text lines
1238: are passed through to the formatters in any case.
1239: Given that the text before the tab character will be filled,
1240: it is hard to predict which tab stop position the tab will advance to.
1241: .It Sy "whitespace at end of input line"
1242: .Pq mdoc , man , roff
1243: Whitespace at the end of input lines is almost never semantically
1244: significant \(em but in the odd case where it might be, it is
1245: extremely confusing when reviewing and maintaining documents.
1246: .It Sy "bad comment style"
1247: .Pq roff
1248: Comment lines start with a dot, a backslash, and a double-quote character.
1249: The
1250: .Nm
1251: utility treats the line as a comment line even without the backslash,
1252: but leaving out the backslash might not be portable.
1253: .It Sy "invalid escape sequence"
1254: .Pq roff
1255: An escape sequence has an invalid opening argument delimiter, lacks the
1256: closing argument delimiter, or the argument has too few characters.
1257: If the argument is incomplete,
1258: .Ic \e*
1259: and
1260: .Ic \en
1261: expand to an empty string,
1262: .Ic \eB
1263: to the digit
1264: .Sq 0 ,
1265: and
1266: .Ic \ew
1267: to the length of the incomplete argument.
1268: All other invalid escape sequences are ignored.
1269: .It Sy "undefined string, using \(dq\(dq"
1270: .Pq roff
1271: If a string is used without being defined before,
1272: its value is implicitly set to the empty string.
1273: However, defining strings explicitly before use
1274: keeps the code more readable.
1275: .El
1276: .Ss "Errors related to equations"
1277: .Bl -inset -compact
1278: .It "unexpected equation scope closure"
1279: .It "equation scope open on exit"
1280: .It "overlapping equation scopes"
1281: .It "unexpected end of equation"
1282: .El
1283: .Ss "Errors related to tables"
1.136 ! schwarze 1284: .Bl -ohang
! 1285: .It Sy "non-alphabetic character in tbl options"
! 1286: .Pq tbl
! 1287: The table options line contains a character other than a letter,
! 1288: blank, or comma where the beginning of an option name is expected.
! 1289: The character is ignored.
! 1290: .It Sy "skipping unknown tbl option"
! 1291: .Pq tbl
! 1292: The table options line contains a string of letters that does not
! 1293: match any known option name.
! 1294: The word is ignored.
! 1295: .It Sy "missing tbl option argument"
! 1296: .Pq tbl
! 1297: A table option that requires an argument is not followed by an
! 1298: opening parenthesis, or the opening parenthesis is immediately
! 1299: followed by a closing parenthesis.
! 1300: The option is ignored.
! 1301: .It Sy "wrong tbl option argument size"
! 1302: .Pq tbl
! 1303: A table option argument contains an invalid number of characters.
! 1304: Both the option and the argument are ignored.
! 1305: .El
! 1306: .Pp
1.106 schwarze 1307: .Bl -inset -compact
1.136 ! schwarze 1308: .It Sy "no table layout cells specified"
! 1309: .It Sy "no table data cells specified"
! 1310: .It Sy "ignore data in cell"
! 1311: .It Sy "data block still open"
! 1312: .It Sy "ignoring extra data cells"
1.106 schwarze 1313: .El
1314: .Ss "Errors related to roff, mdoc, and man code"
1315: .Bl -ohang
1316: .It Sy "input stack limit exceeded, infinite loop?"
1317: .Pq roff
1318: Explicit recursion limits are implemented for the following features,
1319: in order to prevent infinite loops:
1320: .Bl -dash -compact
1321: .It
1322: expansion of nested escape sequences
1323: including expansion of strings and number registers,
1324: .It
1325: expansion of nested user-defined macros,
1326: .It
1327: and
1328: .Ic \&so
1329: file inclusion.
1330: .El
1331: When a limit is hit, the output is incorrect, typically losing
1332: some content, but the parser can continue.
1333: .It Sy "skipping bad character"
1334: .Pq mdoc , man , roff
1335: The input file contains a byte that is not a printable
1336: .Xr ascii 7
1337: character.
1338: The message mentions the character number.
1339: The offending byte is replaced with a question mark
1340: .Pq Sq \&? .
1341: Consider editing the input file to replace the byte with an ASCII
1342: transliteration of the intended character.
1343: .It Sy "skipping unknown macro"
1344: .Pq mdoc , man , roff
1345: The first identifier on a request or macro line is neither recognized as a
1346: .Xr roff 7
1347: request, nor as a user-defined macro, nor, respectively, as an
1348: .Xr mdoc 7
1349: or
1350: .Xr man 7
1351: macro.
1352: It may be mistyped or unsupported.
1353: The request or macro is discarded including its arguments.
1.133 schwarze 1354: .It Sy "skipping insecure request"
1355: .Pq roff
1356: An input file attempted to run a shell command
1357: or to read or write an external file.
1358: Such attempts are denied for security reasons.
1.106 schwarze 1359: .It Sy "skipping item outside list"
1.118 schwarze 1360: .Pq mdoc , eqn
1.106 schwarze 1361: An
1362: .Ic \&It
1363: macro occurs outside any
1364: .Ic \&Bl
1.118 schwarze 1365: list, or an
1366: .Xr eqn 7
1367: .Ic above
1368: delimiter occurs outside any pile.
1.106 schwarze 1369: It is discarded including its arguments.
1370: .It Sy "skipping column outside column list"
1371: .Pq mdoc
1372: A
1373: .Ic \&Ta
1374: macro occurs outside any
1375: .Ic \&Bl Fl column
1376: block.
1377: It is discarded including its arguments.
1378: .It Sy "skipping end of block that is not open"
1379: .Pq mdoc , man , eqn , tbl , roff
1380: Various syntax elements can only be used to explicitly close blocks
1381: that have previously been opened.
1382: An
1383: .Xr mdoc 7
1384: block closing macro, a
1385: .Xr man 7
1386: .Ic \&RE
1387: or
1388: .Ic \&UE
1.118 schwarze 1389: macro, an
1390: .Xr eqn 7
1391: right delimiter or closing brace, or the end of an equation, table, or
1.106 schwarze 1392: .Xr roff 7
1393: conditional request is encountered but no matching block is open.
1394: The offending request or macro is discarded.
1.135 schwarze 1395: .It Sy "fewer RS blocks open, skipping"
1396: .Pq man
1397: The
1398: .Ic \&RE
1399: macro is invoked with an argument, but less than the specified number of
1400: .Ic \&RS
1401: blocks is open.
1402: The
1403: .Ic \&RE
1404: macro is discarded.
1.106 schwarze 1405: .It Sy "inserting missing end of block"
1406: .Pq mdoc , tbl
1407: Various
1408: .Xr mdoc 7
1409: macros as well as tables require explicit closing by dedicated macros.
1410: A block that doesn't support bad nesting
1411: ends before all of its children are properly closed.
1412: The open child nodes are closed implicitly.
1413: .It Sy "scope open on exit"
1414: .Pq mdoc , man , eqn , tbl , roff
1415: At the end of the document, an explicit
1416: .Xr mdoc 7
1417: block, a
1418: .Xr man 7
1419: next-line scope or
1420: .Ic \&RS
1421: or
1422: .Ic \&UR
1423: block, an equation, table, or
1424: .Xr roff 7
1425: conditional or ignore block is still open.
1426: The open block is closed implicitly.
1427: .It Sy "escaped character not allowed in a name"
1428: .Pq roff
1429: Macro, string and register identifiers consist of printable,
1430: non-whitespace ASCII characters.
1431: Escape sequences and characters and strings expressed in terms of them
1432: cannot form part of a name.
1433: The first argument of an
1434: .Ic \&am ,
1435: .Ic \&as ,
1436: .Ic \&de ,
1437: .Ic \&ds ,
1438: .Ic \&nr ,
1439: or
1440: .Ic \&rr
1441: request, or any argument of an
1442: .Ic \&rm
1443: request, or the name of a request or user defined macro being called,
1444: is terminated by an escape sequence.
1445: In the cases of
1446: .Ic \&as ,
1447: .Ic \&ds ,
1448: and
1449: .Ic \&nr ,
1450: the request has no effect at all.
1451: In the cases of
1452: .Ic \&am ,
1453: .Ic \&de ,
1454: .Ic \&rr ,
1455: and
1456: .Ic \&rm ,
1457: what was parsed up to this point is used as the arguments to the request,
1458: and the rest of the input line is discarded including the escape sequence.
1459: When parsing for a request or a user-defined macro name to be called,
1460: only the escape sequence is discarded.
1461: The characters preceding it are used as the request or macro name,
1462: the characters following it are used as the arguments to the request or macro.
1463: .It Sy "argument count wrong"
1464: .Pq mdoc , man , roff
1465: The indicated request or macro has too few or too many arguments.
1466: The syntax tree will contain the wrong number of arguments as given.
1467: Formatting behaviour depends on the specific request or macro in question.
1468: Note that the same message may also occur as a WARNING, see above.
1.124 schwarze 1469: .It Sy "NOT IMPLEMENTED: Bd -file"
1470: .Pq mdoc
1471: For security reasons, the
1472: .Ic \&Bd
1473: macro does not support the
1474: .Fl file
1475: argument.
1476: By requesting the inclusion of a sensitive file, a malicious document
1477: might otherwise trick a privileged user into inadvertently displaying
1478: the file on the screen, revealing the file content to bystanders.
1479: The argument is ignored including the file name following it.
1.106 schwarze 1480: .It Sy "missing list type, using -item"
1481: .Pq mdoc
1482: A
1483: .Ic \&Bl
1484: macro fails to specify the list type.
1485: .It Sy "missing manual name, using \(dq\(dq"
1486: .Pq mdoc
1487: The first call to
1488: .Ic \&Nm
1489: lacks the required argument.
1490: .It Sy "uname(3) system call failed, using UNKNOWN"
1491: .Pq mdoc
1492: The
1493: .Ic \&Os
1494: macro is called without arguments, and the
1495: .Xr uname 3
1496: system call failed.
1497: As a workaround,
1498: .Nm
1499: can be compiled with
1500: .Sm off
1501: .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq .
1502: .Sm on
1503: .It Sy "unknown standard specifier"
1504: .Pq mdoc
1505: An
1506: .Ic \&St
1507: macro has an unknown argument and is discarded.
1508: .It Sy "skipping request without numeric argument"
1.118 schwarze 1509: .Pq roff , eqn
1.106 schwarze 1510: An
1511: .Ic \&it
1.118 schwarze 1512: request or an
1513: .Xr eqn 7
1514: .Ic \&size
1515: or
1516: .Ic \&gsize
1517: statement has a non-numeric or negative argument or no argument at all.
1518: The invalid request or statement is ignored.
1.132 schwarze 1519: .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
1520: .Pq roff
1521: For security reasons,
1522: .Nm
1523: allows
1524: .Ic \&so
1525: file inclusion requests only with relative paths
1526: and only without ascending to any parent directory.
1527: By requesting the inclusion of a sensitive file, a malicious document
1528: might otherwise trick a privileged user into inadvertently displaying
1529: the file on the screen, revealing the file content to bystanders.
1530: .Nm
1531: only shows the path as it appears behind
1532: .Ic \&so .
1533: .It Sy ".so request failed"
1534: .Pq roff
1535: Servicing a
1536: .Ic \&so
1537: request requires reading an external file, but the file could not be
1538: opened.
1539: .Nm
1540: only shows the path as it appears behind
1541: .Ic \&so .
1.106 schwarze 1542: .It Sy "skipping all arguments"
1543: .Pq mdoc , man , eqn , roff
1544: An
1545: .Xr mdoc 7
1546: .Ic \&Bt ,
1547: .Ic \&Ed ,
1548: .Ic \&Ef ,
1549: .Ic \&Ek ,
1550: .Ic \&El ,
1551: .Ic \&Re ,
1552: or
1553: .Ic \&Ud
1554: macro, an
1555: .Ic \&It
1556: macro in a list that don't support item heads, a
1557: .Xr man 7
1558: .Ic \&LP ,
1559: .Ic \&P ,
1560: or
1561: .Ic \&PP
1562: macro, an
1563: .Xr eqn 7
1.120 schwarze 1564: .Ic \&EQ
1565: or
1.106 schwarze 1566: .Ic \&EN
1567: macro, or a
1568: .Xr roff 7
1569: .Sq \&..
1570: block closing request is invoked with at least one argument.
1571: All arguments are ignored.
1572: .It Sy "skipping excess arguments"
1.135 schwarze 1573: .Pq mdoc , man , roff
1.77 schwarze 1574: The
1.106 schwarze 1575: .Ic \&Bf
1.135 schwarze 1576: macro is invoked with more than one argument, the
1577: .Ic \&RE
1578: macro is invoked with more than one argument
1579: or with a non-integer argument, or a request of the
1.106 schwarze 1580: .Ic \&de
1581: family is invoked with more than two arguments.
1582: The excess arguments are ignored.
1.133 schwarze 1583: .El
1584: .Ss Unsupported features
1585: .Bl -ohang
1586: .It Sy "input too large"
1587: .Pq mdoc , man
1588: Currently,
1589: .Nm
1590: cannot handle input files larger than its arbitrary size limit
1591: of 2^31 bytes (2 Gigabytes).
1592: Since useful manuals are always small, this is not a problem in practice.
1593: Parsing is aborted as soon as the condition is detected.
1.136 ! schwarze 1594: .It Sy "unsupported control character"
! 1595: .Pq roff
! 1596: An ASCII control character supported by other
! 1597: .Xr roff 7
! 1598: implementations but not by
! 1599: .Nm
! 1600: was found in an input file.
! 1601: It is replaced by a question mark.
1.133 schwarze 1602: .It Sy "unsupported roff request"
1603: .Pq roff
1604: An input file contains a
1605: .Xr roff 7
1606: request supported by GNU troff or Heirloom troff but not by
1607: .Nm ,
1608: and it is likely that this will cause information loss
1609: or considerable misformatting.
1.136 ! schwarze 1610: .It Sy "unsupported table layout"
1.133 schwarze 1611: .It Sy "ignoring macro in table"
1.106 schwarze 1612: .El
1.20 kristaps 1613: .Sh COMPATIBILITY
1.26 kristaps 1614: This section summarises
1.20 kristaps 1615: .Nm
1.76 kristaps 1616: compatibility with GNU troff.
1.32 kristaps 1617: Each input and output format is separately noted.
1.48 kristaps 1618: .Ss ASCII Compatibility
1.37 kristaps 1619: .Bl -bullet -compact
1.29 kristaps 1620: .It
1.87 kristaps 1621: Unrenderable unicode codepoints specified with
1.86 kristaps 1622: .Sq \e[uNNNN]
1623: escapes are printed as
1624: .Sq \&?
1625: in mandoc.
1626: In GNU troff, these raise an error.
1627: .It
1.49 kristaps 1628: The
1.33 kristaps 1629: .Sq \&Bd \-literal
1.49 kristaps 1630: and
1.32 kristaps 1631: .Sq \&Bd \-unfilled
1632: macros of
1633: .Xr mdoc 7
1634: in
1.58 kristaps 1635: .Fl T Ns Cm ascii
1.32 kristaps 1636: are synonyms, as are \-filled and \-ragged.
1.26 kristaps 1637: .It
1.86 kristaps 1638: In historic GNU troff, the
1.27 kristaps 1639: .Sq \&Pa
1.32 kristaps 1640: .Xr mdoc 7
1641: macro does not underline when scoped under an
1.30 kristaps 1642: .Sq \&It
1.57 kristaps 1643: in the FILES section.
1644: This behaves correctly in
1.27 kristaps 1645: .Nm .
1646: .It
1.58 kristaps 1647: A list or display following the
1.27 kristaps 1648: .Sq \&Ss
1.32 kristaps 1649: .Xr mdoc 7
1650: macro in
1.58 kristaps 1651: .Fl T Ns Cm ascii
1.20 kristaps 1652: does not assert a prior vertical break, just as it doesn't with
1.27 kristaps 1653: .Sq \&Sh .
1.20 kristaps 1654: .It
1.32 kristaps 1655: The
1656: .Sq \&na
1657: .Xr man 7
1.34 kristaps 1658: macro in
1.58 kristaps 1659: .Fl T Ns Cm ascii
1.34 kristaps 1660: has no effect.
1.20 kristaps 1661: .It
1662: Words aren't hyphenated.
1663: .El
1.114 kristaps 1664: .Ss HTML Compatibility
1.42 kristaps 1665: .Bl -bullet -compact
1666: .It
1667: The
1.47 kristaps 1668: .Sq \efP
1669: escape will revert the font to the previous
1670: .Sq \ef
1671: escape, not to the last rendered decoration, which is now dictated by
1.57 kristaps 1672: CSS instead of hard-coded.
1673: It also will not span past the current scope,
1674: for the same reason.
1675: Note that in
1.47 kristaps 1676: .Sx ASCII Output
1677: mode, this will work fine.
1678: .It
1679: The
1.42 kristaps 1680: .Xr mdoc 7
1681: .Sq \&Bl \-hang
1682: and
1683: .Sq \&Bl \-tag
1684: list types render similarly (no break following overreached left-hand
1685: side) due to the expressive constraints of HTML.
1686: .It
1687: The
1688: .Xr man 7
1689: .Sq IP
1690: and
1691: .Sq TP
1692: lists render similarly.
1693: .El
1.1 kristaps 1694: .Sh SEE ALSO
1.85 kristaps 1695: .Xr eqn 7 ,
1.57 kristaps 1696: .Xr man 7 ,
1.13 kristaps 1697: .Xr mandoc_char 7 ,
1.84 kristaps 1698: .Xr mdoc 7 ,
1699: .Xr roff 7 ,
1700: .Xr tbl 7
1.1 kristaps 1701: .Sh AUTHORS
1702: The
1703: .Nm
1.26 kristaps 1704: utility was written by
1.103 schwarze 1705: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.39 kristaps 1706: .Sh CAVEATS
1707: In
1.58 kristaps 1708: .Fl T Ns Cm html
1.50 kristaps 1709: and
1.58 kristaps 1710: .Fl T Ns Cm xhtml ,
1.39 kristaps 1711: the maximum size of an element attribute is determined by
1712: .Dv BUFSIZ ,
1.57 kristaps 1713: which is usually 1024 bytes.
1714: Be aware of this when setting long link
1.58 kristaps 1715: formats such as
1716: .Fl O Ns Cm style Ns = Ns Ar really/long/link .
1.51 kristaps 1717: .Pp
1718: Nesting elements within next-line element scopes of
1.58 kristaps 1719: .Fl m Ns Cm an ,
1.51 kristaps 1720: such as
1721: .Sq br
1722: within an empty
1723: .Sq B ,
1724: will confuse
1.58 kristaps 1725: .Fl T Ns Cm html
1.51 kristaps 1726: and
1.58 kristaps 1727: .Fl T Ns Cm xhtml
1.52 kristaps 1728: and cause them to forget the formatting of the prior next-line scope.
1.53 kristaps 1729: .Pp
1.54 kristaps 1730: The
1731: .Sq \(aq
1.55 kristaps 1732: control character is an alias for the standard macro control character
1733: and does not emit a line-break as stipulated in GNU troff.
CVSweb