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