[BACK]Return to mandoc.1 CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/mandoc.1, Revision 1.131

1.131   ! schwarze    1: .\"    $Id: mandoc.1,v 1.130 2014/12/28 14:42:27 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.131   ! schwarze   18: .Dd $Mdocdate: December 28 2014 $
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
                    162: .Cm warning ,
                    163: .Cm error ,
                    164: or
                    165: .Cm fatal .
                    166: The default is
                    167: .Fl W Ns Cm fatal ;
1.58      kristaps  168: .Fl W Ns Cm all
1.77      schwarze  169: is an alias for
                    170: .Fl W Ns Cm warning .
                    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
                    535: At least one parsing error occurred, but no fatal error, and
                    536: .Fl W Ns Cm error
                    537: or
                    538: .Fl W Ns Cm warning
                    539: was specified.
                    540: .It 4
                    541: A fatal parsing error occurred.
                    542: .It 5
                    543: Invalid command line arguments were specified.
                    544: No input files have been read.
                    545: .It 6
1.131   ! schwarze  546: An operating system error occurred, for example exhaustion
        !           547: of memory, file descriptors, or process table entries.
1.77      schwarze  548: Such errors cause
                    549: .Nm
                    550: to exit at once, possibly in the middle of parsing or formatting a file.
                    551: .El
                    552: .Pp
                    553: Note that selecting
                    554: .Fl T Ns Cm lint
                    555: output mode implies
                    556: .Fl W Ns Cm warning .
1.1       kristaps  557: .Sh EXAMPLES
1.13      kristaps  558: To page manuals to the terminal:
1.1       kristaps  559: .Pp
1.82      kristaps  560: .Dl $ mandoc \-Wall,stop mandoc.1 2\*(Gt&1 | less
                    561: .Dl $ mandoc mandoc.1 mdoc.3 mdoc.7 | less
1.28      kristaps  562: .Pp
1.41      kristaps  563: To produce HTML manuals with
                    564: .Ar style.css
                    565: as the style-sheet:
1.38      kristaps  566: .Pp
1.82      kristaps  567: .Dl $ mandoc \-Thtml -Ostyle=style.css mdoc.7 \*(Gt mdoc.7.html
1.38      kristaps  568: .Pp
1.28      kristaps  569: To check over a large set of manuals:
                    570: .Pp
1.77      schwarze  571: .Dl $ mandoc \-Tlint `find /usr/src -name \e*\e.[1-9]`
1.66      kristaps  572: .Pp
                    573: To produce a series of PostScript manuals for A4 paper:
                    574: .Pp
1.82      kristaps  575: .Dl $ mandoc \-Tps \-Opaper=a4 mdoc.7 man.7 \*(Gt manuals.ps
1.91      schwarze  576: .Pp
                    577: Convert a modern
                    578: .Xr mdoc 7
                    579: manual to the older
                    580: .Xr man 7
                    581: format, for use on systems lacking an
                    582: .Xr mdoc 7
                    583: parser:
                    584: .Pp
                    585: .Dl $ mandoc \-Tman foo.mdoc \*(Gt foo.man
1.77      schwarze  586: .Sh DIAGNOSTICS
1.106     schwarze  587: Messages displayed by
                    588: .Nm
                    589: follow this format:
1.77      schwarze  590: .Pp
1.106     schwarze  591: .D1 Nm Ns : Ar file : Ns Ar line : Ns Ar column : level : message : macro args
1.77      schwarze  592: .Pp
1.106     schwarze  593: Line and column numbers start at 1.
                    594: Both are omitted for messages referring to an input file as a whole.
                    595: Macro names and arguments are omitted where meaningless.
                    596: Fatal messages about invalid command line arguments
                    597: or operating system errors, for example when memory is exhausted,
                    598: may also omit the
                    599: .Ar file
1.104     schwarze  600: and
1.106     schwarze  601: .Ar level
                    602: fields.
1.104     schwarze  603: .Pp
1.77      schwarze  604: Message levels have the following meanings:
                    605: .Bl -tag -width "warning"
                    606: .It Cm fatal
                    607: The parser is unable to parse a given input file at all.
                    608: No formatted output is produced from that input file.
                    609: .It Cm error
                    610: An input file contains syntax that cannot be safely interpreted,
                    611: either because it is invalid or because
                    612: .Nm
                    613: does not implement it yet.
                    614: By discarding part of the input or inserting missing tokens,
                    615: the parser is able to continue, and the error does not prevent
                    616: generation of formatted output, but typically, preparing that
                    617: output involves information loss, broken document structure
                    618: or unintended formatting.
1.131   ! schwarze  619: .Pp
        !           620: Non-existent or unreadable input files are also reported on the
        !           621: .Cm error
        !           622: level.
        !           623: In that case, the parser cannot even be started and no output
        !           624: is produced from those input files.
1.77      schwarze  625: .It Cm warning
                    626: An input file uses obsolete, discouraged or non-portable syntax.
                    627: All the same, the meaning of the input is unambiguous and a correct
                    628: rendering can be produced.
                    629: Documents causing warnings may render poorly when using other
                    630: formatting tools instead of
                    631: .Nm .
                    632: .El
                    633: .Pp
                    634: Messages of the
                    635: .Cm warning
                    636: and
                    637: .Cm error
1.131   ! schwarze  638: levels except those about non-existent or unreadable input files
        !           639: are hidden unless their level, or a lower level, is requested using a
1.77      schwarze  640: .Fl W
                    641: option or
                    642: .Fl T Ns Cm lint
                    643: output mode.
1.106     schwarze  644: .Ss Warnings related to the document prologue
                    645: .Bl -ohang
                    646: .It Sy "missing manual title, using UNTITLED"
                    647: .Pq mdoc
                    648: A
                    649: .Ic \&Dt
                    650: macro has no arguments, or there is no
                    651: .Ic \&Dt
                    652: macro before the first non-prologue macro.
                    653: .It Sy "missing manual title, using \(dq\(dq"
                    654: .Pq man
                    655: There is no
                    656: .Ic \&TH
                    657: macro, or it has no arguments.
                    658: .It Sy "lower case character in document title"
                    659: .Pq mdoc , man
                    660: The title is still used as given in the
                    661: .Ic \&Dt
                    662: or
                    663: .Ic \&TH
                    664: macro.
                    665: .It Sy "missing manual section, using \(dq\(dq"
                    666: .Pq mdoc , man
                    667: A
                    668: .Ic \&Dt
                    669: or
                    670: .Ic \&TH
                    671: macro lacks the mandatory section argument.
                    672: .It Sy "unknown manual section"
                    673: .Pq mdoc
                    674: The section number in a
                    675: .Ic \&Dt
                    676: line is invalid, but still used.
                    677: .It Sy "missing date, using today's date"
                    678: .Pq mdoc, man
                    679: The document was parsed as
                    680: .Xr mdoc 7
                    681: and it has no
                    682: .Ic \&Dd
                    683: macro, or the
                    684: .Ic \&Dd
                    685: macro has no arguments or only empty arguments;
                    686: or the document was parsed as
                    687: .Xr man 7
                    688: and it has no
                    689: .Ic \&TH
                    690: macro, or the
                    691: .Ic \&TH
                    692: macro has less than three arguments or its third argument is empty.
                    693: .It Sy "cannot parse date, using it verbatim"
                    694: .Pq mdoc , man
                    695: The date given in a
                    696: .Ic \&Dd
                    697: or
                    698: .Ic \&TH
                    699: macro does not follow the conventional format.
                    700: .It Sy "missing Os macro, using \(dq\(dq"
                    701: .Pq mdoc
                    702: The default or current system is not shown in this case.
                    703: .It Sy "duplicate prologue macro"
                    704: .Pq mdoc
                    705: One of the prologue macros occurs more than once.
                    706: The last instance overrides all previous ones.
                    707: .It Sy "late prologue macro"
                    708: .Pq mdoc
                    709: A
                    710: .Ic \&Dd
                    711: or
                    712: .Ic \&Os
                    713: macro occurs after some non-prologue macro, but still takes effect.
                    714: .It Sy "skipping late title macro"
                    715: .Pq mdoc
                    716: The
                    717: .Ic \&Dt
                    718: macro can only occur before the first non-prologue macro
                    719: because traditional formatters write the page header
                    720: before parsing the document body.
                    721: Even though this technical restriction does not apply to
                    722: .Nm ,
                    723: traditional semantics is preserved.
                    724: The late macro is discarded including its arguments.
                    725: .It Sy "prologue macros out of order"
                    726: .Pq mdoc
                    727: The prologue macros are not given in the conventional order
                    728: .Ic \&Dd ,
                    729: .Ic \&Dt ,
                    730: .Ic \&Os .
                    731: All three macros are used even when given in another order.
                    732: .El
                    733: .Ss Warnings regarding document structure
                    734: .Bl -ohang
                    735: .It Sy ".so is fragile, better use ln(1)"
                    736: .Pq roff
                    737: Including files only works when the parser program runs with the correct
                    738: current working directory.
                    739: .It Sy "no document body"
                    740: .Pq mdoc , man
                    741: The document body contains neither text nor macros.
                    742: An empty document is shown, consisting only of a header and a footer line.
                    743: .It Sy "content before first section header"
                    744: .Pq mdoc , man
                    745: Some macros or text precede the first
                    746: .Ic \&Sh
                    747: or
                    748: .Ic \&SH
                    749: section header.
                    750: The offending macros and text are parsed and added to the top level
                    751: of the syntax tree, outside any section block.
                    752: .It Sy "first section is not NAME"
                    753: .Pq mdoc
                    754: The argument of the first
                    755: .Ic \&Sh
                    756: macro is not
                    757: .Sq NAME .
                    758: This may confuse
                    759: .Xr makewhatis 8
                    760: and
                    761: .Xr apropos 1 .
                    762: .It Sy "bad NAME section contents"
                    763: .Pq mdoc
                    764: The last node in the NAME section is not an
                    765: .Ic \&Nd
                    766: macro, or any preceding macro is not
                    767: .Ic \&Nm ,
                    768: or the NAME section is completely empty.
                    769: This may confuse
                    770: .Xr makewhatis 8
                    771: and
                    772: .Xr apropos 1 .
                    773: .It Sy "sections out of conventional order"
                    774: .Pq mdoc
                    775: A standard section occurs after another section it usually precedes.
                    776: All section titles are used as given,
                    777: and the order of sections is not changed.
                    778: .It Sy "duplicate section title"
                    779: .Pq mdoc
                    780: The same standard section title occurs more than once.
                    781: .It Sy "unexpected section"
                    782: .Pq mdoc
                    783: A standard section header occurs in a section of the manual
                    784: where it normally isn't useful.
1.112     schwarze  785: .It Sy "unusual Xr order"
                    786: .Pq mdoc
                    787: In the SEE ALSO section, an
                    788: .Ic \&Xr
                    789: macro with a lower section number follows one with a higher number,
                    790: or two
                    791: .Ic \&Xr
                    792: macros refering to the same section are out of alphabetical order.
                    793: .It Sy "unusual Xr punctuation"
                    794: .Pq mdoc
                    795: In the SEE ALSO section, punctuation between two
                    796: .Ic \&Xr
                    797: macros differs from a single comma, or there is trailing punctuation
                    798: after the last
                    799: .Ic \&Xr
                    800: macro.
1.111     schwarze  801: .It Sy "AUTHORS section without An macro"
                    802: .Pq mdoc
                    803: An AUTHORS sections contains no
                    804: .Ic \&An
                    805: macros, or only empty ones.
                    806: Probably, there are author names lacking markup.
1.106     schwarze  807: .El
                    808: .Ss "Warnings related to macros and nesting"
                    809: .Bl -ohang
                    810: .It Sy "obsolete macro"
                    811: .Pq mdoc
                    812: See the
                    813: .Xr mdoc 7
                    814: manual for replacements.
1.126     schwarze  815: .It Sy "macro neither callable nor escaped"
                    816: .Pq mdoc
                    817: The name of a macro that is not callable appears on a macro line.
                    818: It is printed verbatim.
                    819: If the intention is to call it, move it to its own line;
                    820: otherwise, escape it by prepending
                    821: .Sq \e& .
1.106     schwarze  822: .It Sy "skipping paragraph macro"
                    823: In
                    824: .Xr mdoc 7
                    825: documents, this happens
                    826: .Bl -dash -compact
                    827: .It
                    828: at the beginning and end of sections and subsections
                    829: .It
                    830: right before non-compact lists and displays
                    831: .It
                    832: at the end of items in non-column, non-compact lists
                    833: .It
                    834: and for multiple consecutive paragraph macros.
                    835: .El
                    836: In
                    837: .Xr man 7
                    838: documents, it happens
                    839: .Bl -dash -compact
                    840: .It
                    841: for empty
                    842: .Ic \&P ,
                    843: .Ic \&PP ,
                    844: and
                    845: .Ic \&LP
                    846: macros
                    847: .It
                    848: for
                    849: .Ic \&IP
                    850: macros having neither head nor body arguments
                    851: .It
                    852: for
                    853: .Ic \&br
                    854: or
                    855: .Ic \&sp
                    856: right after
                    857: .Ic \&SH
                    858: or
                    859: .Ic \&SS
                    860: .El
                    861: .It Sy "moving paragraph macro out of list"
                    862: .Pq mdoc
                    863: A list item in a
                    864: .Ic \&Bl
                    865: list contains a trailing paragraph macro.
                    866: The paragraph macro is moved after the end of the list.
                    867: .It Sy "skipping no-space macro"
                    868: .Pq mdoc
                    869: An input line begins with an
                    870: .Ic \&Ns
                    871: macro.
                    872: The macro is ignored.
                    873: .It Sy "blocks badly nested"
                    874: .Pq mdoc
                    875: If two blocks intersect, one should completely contain the other.
                    876: Otherwise, rendered output is likely to look strange in any output
                    877: format, and rendering in SGML-based output formats is likely to be
                    878: outright wrong because such languages do not support badly nested
                    879: blocks at all.
                    880: Typical examples of badly nested blocks are
                    881: .Qq Ic \&Ao \&Bo \&Ac \&Bc
                    882: and
                    883: .Qq Ic \&Ao \&Bq \&Ac .
                    884: In these examples,
                    885: .Ic \&Ac
                    886: breaks
                    887: .Ic \&Bo
                    888: and
                    889: .Ic \&Bq ,
                    890: respectively.
                    891: .It Sy "nested displays are not portable"
                    892: .Pq mdoc
                    893: A
                    894: .Ic \&Bd ,
                    895: .Ic \&D1 ,
                    896: or
                    897: .Ic \&Dl
                    898: display occurs nested inside another
                    899: .Ic \&Bd
                    900: display.
                    901: This works with
                    902: .Nm ,
                    903: but fails with most other implementations.
                    904: .It Sy "moving content out of list"
                    905: .Pq mdoc
                    906: A
                    907: .Ic \&Bl
                    908: list block contains text or macros before the first
                    909: .Ic \&It
                    910: macro.
                    911: The offending children are moved before the beginning of the list.
                    912: .It Sy ".Vt block has child macro"
                    913: .Pq mdoc
                    914: The
                    915: .Ic \&Vt
                    916: macro supports plain text arguments only.
                    917: Formatting may be ugly and semantic searching
                    918: for the affected content might not work.
                    919: .It Sy "fill mode already enabled, skipping"
                    920: .Pq man
                    921: A
                    922: .Ic \&fi
                    923: request occurs even though the document is still in fill mode,
                    924: or already switched back to fill mode.
                    925: It has no effect.
                    926: .It Sy "fill mode already disabled, skipping"
                    927: .Pq man
                    928: An
                    929: .Ic \&nf
                    930: request occurs even though the document already switched to no-fill mode
                    931: and did not switch back to fill mode yet.
                    932: It has no effect.
                    933: .It Sy "line scope broken"
                    934: .Pq man
                    935: While parsing the next-line scope of the previous macro,
                    936: another macro is found that prematurely terminates the previous one.
                    937: The previous, interrupted macro is deleted from the parse tree.
                    938: .El
                    939: .Ss "Warnings related to missing arguments"
                    940: .Bl -ohang
                    941: .It Sy "skipping empty request"
1.118     schwarze  942: .Pq roff , eqn
                    943: The macro name is missing from a macro definition request,
                    944: or an
                    945: .Xr eqn 7
                    946: control statement or operation keyword lacks its required argument.
1.106     schwarze  947: .It Sy "conditional request controls empty scope"
                    948: .Pq roff
                    949: A conditional request is only useful if any of the following
                    950: follows it on the same logical input line:
                    951: .Bl -dash -compact
                    952: .It
                    953: The
                    954: .Sq \e{
                    955: keyword to open a multi-line scope.
                    956: .It
                    957: A request or macro or some text, resulting in a single-line scope.
                    958: .It
                    959: The immediate end of the logical line without any intervening whitespace,
                    960: resulting in next-line scope.
                    961: .El
                    962: Here, a conditional request is followed by trailing whitespace only,
                    963: and there is no other content on its logical input line.
                    964: Note that it doesn't matter whether the logical input line is split
                    965: across multiple physical input lines using
                    966: .Sq \e
                    967: line continuation characters.
                    968: This is one of the rare cases
                    969: where trailing whitespace is syntactically significant.
                    970: The conditional request controls a scope containing whitespace only,
                    971: so it is unlikely to have a significant effect,
                    972: except that it may control a following
                    973: .Ic \&el
                    974: clause.
                    975: .It Sy "skipping empty macro"
                    976: .Pq mdoc
                    977: The indicated macro has no arguments and hence no effect.
                    978: .It Sy "empty argument, using 0n"
                    979: .Pq mdoc
                    980: The required width is missing after
                    981: .Ic \&Bd
                    982: or
                    983: .Ic \&Bl
                    984: .Fl offset
                    985: or
                    986: .Fl width.
                    987: .It Sy "argument count wrong"
                    988: .Pq mdoc , man
                    989: The indicated macro has too few or too many arguments.
                    990: The syntax tree will contain the wrong number of arguments as given.
                    991: Formatting behaviour depends on the specific macro in question.
                    992: Note that the same message may also occur as an ERROR, see below.
                    993: .It Sy "missing display type, using -ragged"
                    994: .Pq mdoc
                    995: The
                    996: .Ic \&Bd
                    997: macro is invoked without the required display type.
                    998: .It Sy "list type is not the first argument"
                    999: .Pq mdoc
                   1000: In a
                   1001: .Ic \&Bl
                   1002: macro, at least one other argument precedes the type argument.
                   1003: The
                   1004: .Nm
                   1005: utility copes with any argument order, but some other
                   1006: .Xr mdoc 7
                   1007: implementations do not.
                   1008: .It Sy "missing -width in -tag list, using 8n"
                   1009: .Pq mdoc
                   1010: Every
                   1011: .Ic \&Bl
                   1012: macro having the
                   1013: .Fl tag
                   1014: argument requires
                   1015: .Fl width ,
                   1016: too.
                   1017: .It Sy "missing utility name, using \(dq\(dq"
                   1018: .Pq mdoc
                   1019: The
                   1020: .Ic \&Ex Fl std
                   1021: macro is called without an argument before
                   1022: .Ic \&Nm
                   1023: has first been called with an argument.
                   1024: .It Sy "empty head in list item"
                   1025: .Pq mdoc
                   1026: In a
                   1027: .Ic \&Bl
                   1028: .Fl diag ,
                   1029: .Fl hang ,
                   1030: .Fl inset ,
                   1031: .Fl ohang ,
                   1032: or
                   1033: .Fl tag
                   1034: list, an
                   1035: .Ic \&It
                   1036: macro lacks the required argument.
                   1037: The item head is left empty.
                   1038: .It Sy "empty list item"
                   1039: .Pq mdoc
                   1040: In a
                   1041: .Ic \&Bl
                   1042: .Fl bullet ,
                   1043: .Fl dash ,
                   1044: .Fl enum ,
                   1045: or
                   1046: .Fl hyphen
                   1047: list, an
                   1048: .Ic \&It
                   1049: block is empty.
                   1050: An empty list item is shown.
                   1051: .It Sy "missing font type"
                   1052: .Pq mdoc
                   1053: A
                   1054: .Ic \&Bf
                   1055: macro has no argument.
                   1056: It switches to the default font,
                   1057: .Cm \efR .
                   1058: .It Sy "unknown font type"
                   1059: .Pq mdoc
                   1060: The
                   1061: .Ic \&Bf
                   1062: argument is invalid.
                   1063: The default font
                   1064: .Cm \efR
                   1065: is used instead.
1.127     schwarze 1066: .It Sy "nothing follows prefix"
                   1067: .Pq mdoc
                   1068: A
                   1069: .Ic \&Pf
                   1070: macro has no argument, or only one argument and no macro follows
                   1071: on the same input line.
                   1072: This defeats its purpose; in particular, spacing is not suppressed
                   1073: before the text or macros following on the next input line.
1.106     schwarze 1074: .It Sy "missing -std argument, adding it"
                   1075: .Pq mdoc
                   1076: An
                   1077: .Ic \&Ex
                   1078: or
                   1079: .Ic \&Rv
                   1080: macro lacks the required
                   1081: .Fl std
                   1082: argument.
                   1083: The
                   1084: .Nm
                   1085: utility assumes
                   1086: .Fl std
                   1087: even when it is not specified, but other implementations may not.
1.118     schwarze 1088: .It Sy "missing eqn box, using \(dq\(dq"
                   1089: .Pq eqn
                   1090: A diacritic mark or a binary operator is found,
                   1091: but there is nothing to the left of it.
                   1092: An empty box is inserted.
1.106     schwarze 1093: .El
                   1094: .Ss "Warnings related to bad macro arguments"
                   1095: .Bl -ohang
                   1096: .It Sy "unterminated quoted argument"
                   1097: .Pq roff
                   1098: Macro arguments can be enclosed in double quote characters
                   1099: such that space characters and macro names contained in the quoted
                   1100: argument need not be escaped.
                   1101: The closing quote of the last argument of a macro can be omitted.
                   1102: However, omitting it is not recommended because it makes the code
                   1103: harder to read.
                   1104: .It Sy "duplicate argument"
                   1105: .Pq mdoc
                   1106: A
                   1107: .Ic \&Bd
                   1108: or
                   1109: .Ic \&Bl
                   1110: macro has more than one
                   1111: .Fl compact ,
                   1112: more than one
                   1113: .Fl offset ,
                   1114: or more than one
                   1115: .Fl width
                   1116: argument.
                   1117: All but the last instances of these arguments are ignored.
                   1118: .It Sy "skipping duplicate argument"
                   1119: .Pq mdoc
                   1120: An
                   1121: .Ic \&An
                   1122: macro has more than one
                   1123: .Fl split
                   1124: or
                   1125: .Fl nosplit
                   1126: argument.
                   1127: All but the first of these arguments are ignored.
                   1128: .It Sy "skipping duplicate display type"
                   1129: .Pq mdoc
                   1130: A
                   1131: .Ic \&Bd
                   1132: macro has more than one type argument; the first one is used.
                   1133: .It Sy "skipping duplicate list type"
                   1134: .Pq mdoc
                   1135: A
                   1136: .Ic \&Bl
                   1137: macro has more than one type argument; the first one is used.
                   1138: .It Sy "skipping -width argument"
                   1139: .Pq mdoc
                   1140: A
                   1141: .Ic \&Bl
                   1142: .Fl column ,
                   1143: .Fl diag ,
                   1144: .Fl ohang ,
                   1145: .Fl inset ,
                   1146: or
                   1147: .Fl item
                   1148: list has a
                   1149: .Fl width
                   1150: argument.
                   1151: That has no effect.
                   1152: .It Sy "unknown AT&T UNIX version"
                   1153: .Pq mdoc
                   1154: An
                   1155: .Ic \&At
                   1156: macro has an invalid argument.
                   1157: It is used verbatim, with
                   1158: .Qq "AT&T UNIX "
                   1159: prefixed to it.
1.113     schwarze 1160: .It Sy "comma in function argument"
                   1161: .Pq mdoc
                   1162: An argument of an
                   1163: .Ic \&Fa
                   1164: or
                   1165: .Ic \&Fn
                   1166: macro contains a comma; it should probably be split into two arguments.
1.117     schwarze 1167: .It Sy "parenthesis in function name"
                   1168: .Pq mdoc
                   1169: The first argument of an
                   1170: .Ic \&Fc
                   1171: or
                   1172: .Ic \&Fn
                   1173: macro contains an opening or closing parenthesis; that's probably wrong,
                   1174: parentheses are added automatically.
1.106     schwarze 1175: .It Sy "invalid content in Rs block"
                   1176: .Pq mdoc
                   1177: An
                   1178: .Ic \&Rs
                   1179: block contains plain text or non-% macros.
                   1180: The bogus content is left in the syntax tree.
                   1181: Formatting may be poor.
                   1182: .It Sy "invalid Boolean argument"
                   1183: .Pq mdoc
                   1184: An
                   1185: .Ic \&Sm
                   1186: macro has an argument other than
                   1187: .Cm on
                   1188: or
                   1189: .Cm off .
                   1190: The invalid argument is moved out of the macro, which leaves the macro
                   1191: empty, causing it to toggle the spacing mode.
                   1192: .It Sy "unknown font, skipping request"
1.115     schwarze 1193: .Pq man , tbl
1.106     schwarze 1194: A
                   1195: .Xr roff 7
                   1196: .Ic \&ft
1.115     schwarze 1197: request or a
                   1198: .Xr tbl 7
                   1199: .Ic \&f
                   1200: layout modifier has an unknown
                   1201: .Ar font
                   1202: argument.
1.106     schwarze 1203: .El
                   1204: .Ss "Warnings related to plain text"
                   1205: .Bl -ohang
                   1206: .It Sy "blank line in fill mode, using .sp"
                   1207: .Pq mdoc
                   1208: The meaning of blank input lines is only well-defined in non-fill mode:
                   1209: In fill mode, line breaks of text input lines are not supposed to be
                   1210: significant.
                   1211: However, for compatibility with groff, blank lines in fill mode
                   1212: are replaced with
                   1213: .Ic \&sp
                   1214: requests.
                   1215: .It Sy "tab in filled text"
                   1216: .Pq mdoc , man
                   1217: The meaning of tab characters is only well-defined in non-fill mode:
                   1218: In fill mode, whitespace is not supposed to be significant
                   1219: on text input lines.
                   1220: As an implementation dependent choice, tab characters on text lines
                   1221: are passed through to the formatters in any case.
                   1222: Given that the text before the tab character will be filled,
                   1223: it is hard to predict which tab stop position the tab will advance to.
                   1224: .It Sy "whitespace at end of input line"
                   1225: .Pq mdoc , man , roff
                   1226: Whitespace at the end of input lines is almost never semantically
                   1227: significant \(em but in the odd case where it might be, it is
                   1228: extremely confusing when reviewing and maintaining documents.
                   1229: .It Sy "bad comment style"
                   1230: .Pq roff
                   1231: Comment lines start with a dot, a backslash, and a double-quote character.
                   1232: The
                   1233: .Nm
                   1234: utility treats the line as a comment line even without the backslash,
                   1235: but leaving out the backslash might not be portable.
                   1236: .It Sy "invalid escape sequence"
                   1237: .Pq roff
                   1238: An escape sequence has an invalid opening argument delimiter, lacks the
                   1239: closing argument delimiter, or the argument has too few characters.
                   1240: If the argument is incomplete,
                   1241: .Ic \e*
                   1242: and
                   1243: .Ic \en
                   1244: expand to an empty string,
                   1245: .Ic \eB
                   1246: to the digit
                   1247: .Sq 0 ,
                   1248: and
                   1249: .Ic \ew
                   1250: to the length of the incomplete argument.
                   1251: All other invalid escape sequences are ignored.
                   1252: .It Sy "undefined string, using \(dq\(dq"
                   1253: .Pq roff
                   1254: If a string is used without being defined before,
                   1255: its value is implicitly set to the empty string.
                   1256: However, defining strings explicitly before use
                   1257: keeps the code more readable.
                   1258: .El
                   1259: .Ss "Errors related to equations"
                   1260: .Bl -inset -compact
                   1261: .It "unexpected equation scope closure"
                   1262: .It "equation scope open on exit"
                   1263: .It "overlapping equation scopes"
                   1264: .It "unexpected end of equation"
                   1265: .El
                   1266: .Ss "Errors related to tables"
                   1267: .Bl -inset -compact
                   1268: .It "bad table syntax"
                   1269: .It "bad table option"
                   1270: .It "bad table layout"
                   1271: .It "no table layout cells specified"
                   1272: .It "no table data cells specified"
                   1273: .It "ignore data in cell"
                   1274: .It "data block still open"
                   1275: .It "ignoring extra data cells"
1.129     schwarze 1276: .It "ignoring macro in table"
1.106     schwarze 1277: .El
                   1278: .Ss "Errors related to roff, mdoc, and man code"
                   1279: .Bl -ohang
                   1280: .It Sy "input stack limit exceeded, infinite loop?"
                   1281: .Pq roff
                   1282: Explicit recursion limits are implemented for the following features,
                   1283: in order to prevent infinite loops:
                   1284: .Bl -dash -compact
                   1285: .It
                   1286: expansion of nested escape sequences
                   1287: including expansion of strings and number registers,
                   1288: .It
                   1289: expansion of nested user-defined macros,
                   1290: .It
                   1291: and
                   1292: .Ic \&so
                   1293: file inclusion.
                   1294: .El
                   1295: When a limit is hit, the output is incorrect, typically losing
                   1296: some content, but the parser can continue.
                   1297: .It Sy "skipping bad character"
                   1298: .Pq mdoc , man , roff
                   1299: The input file contains a byte that is not a printable
                   1300: .Xr ascii 7
                   1301: character.
                   1302: The message mentions the character number.
                   1303: The offending byte is replaced with a question mark
                   1304: .Pq Sq \&? .
                   1305: Consider editing the input file to replace the byte with an ASCII
                   1306: transliteration of the intended character.
                   1307: .It Sy "skipping unknown macro"
                   1308: .Pq mdoc , man , roff
                   1309: The first identifier on a request or macro line is neither recognized as a
                   1310: .Xr roff 7
                   1311: request, nor as a user-defined macro, nor, respectively, as an
                   1312: .Xr mdoc 7
                   1313: or
                   1314: .Xr man 7
                   1315: macro.
                   1316: It may be mistyped or unsupported.
                   1317: The request or macro is discarded including its arguments.
                   1318: .It Sy "skipping item outside list"
1.118     schwarze 1319: .Pq mdoc , eqn
1.106     schwarze 1320: An
                   1321: .Ic \&It
                   1322: macro occurs outside any
                   1323: .Ic \&Bl
1.118     schwarze 1324: list, or an
                   1325: .Xr eqn 7
                   1326: .Ic above
                   1327: delimiter occurs outside any pile.
1.106     schwarze 1328: It is discarded including its arguments.
                   1329: .It Sy "skipping column outside column list"
                   1330: .Pq mdoc
                   1331: A
                   1332: .Ic \&Ta
                   1333: macro occurs outside any
                   1334: .Ic \&Bl Fl column
                   1335: block.
                   1336: It is discarded including its arguments.
                   1337: .It Sy "skipping end of block that is not open"
                   1338: .Pq mdoc , man , eqn , tbl , roff
                   1339: Various syntax elements can only be used to explicitly close blocks
                   1340: that have previously been opened.
                   1341: An
                   1342: .Xr mdoc 7
                   1343: block closing macro, a
                   1344: .Xr man 7
                   1345: .Ic \&RE
                   1346: or
                   1347: .Ic \&UE
1.118     schwarze 1348: macro, an
                   1349: .Xr eqn 7
                   1350: right delimiter or closing brace, or the end of an equation, table, or
1.106     schwarze 1351: .Xr roff 7
                   1352: conditional request is encountered but no matching block is open.
                   1353: The offending request or macro is discarded.
                   1354: .It Sy "inserting missing end of block"
                   1355: .Pq mdoc , tbl
                   1356: Various
                   1357: .Xr mdoc 7
                   1358: macros as well as tables require explicit closing by dedicated macros.
                   1359: A block that doesn't support bad nesting
                   1360: ends before all of its children are properly closed.
                   1361: The open child nodes are closed implicitly.
                   1362: .It Sy "scope open on exit"
                   1363: .Pq mdoc , man , eqn , tbl , roff
                   1364: At the end of the document, an explicit
                   1365: .Xr mdoc 7
                   1366: block, a
                   1367: .Xr man 7
                   1368: next-line scope or
                   1369: .Ic \&RS
                   1370: or
                   1371: .Ic \&UR
                   1372: block, an equation, table, or
                   1373: .Xr roff 7
                   1374: conditional or ignore block is still open.
                   1375: The open block is closed implicitly.
                   1376: .It Sy "escaped character not allowed in a name"
                   1377: .Pq roff
                   1378: Macro, string and register identifiers consist of printable,
                   1379: non-whitespace ASCII characters.
                   1380: Escape sequences and characters and strings expressed in terms of them
                   1381: cannot form part of a name.
                   1382: The first argument of an
                   1383: .Ic \&am ,
                   1384: .Ic \&as ,
                   1385: .Ic \&de ,
                   1386: .Ic \&ds ,
                   1387: .Ic \&nr ,
                   1388: or
                   1389: .Ic \&rr
                   1390: request, or any argument of an
                   1391: .Ic \&rm
                   1392: request, or the name of a request or user defined macro being called,
                   1393: is terminated by an escape sequence.
                   1394: In the cases of
                   1395: .Ic \&as ,
                   1396: .Ic \&ds ,
                   1397: and
                   1398: .Ic \&nr ,
                   1399: the request has no effect at all.
                   1400: In the cases of
                   1401: .Ic \&am ,
                   1402: .Ic \&de ,
                   1403: .Ic \&rr ,
                   1404: and
                   1405: .Ic \&rm ,
                   1406: what was parsed up to this point is used as the arguments to the request,
                   1407: and the rest of the input line is discarded including the escape sequence.
                   1408: When parsing for a request or a user-defined macro name to be called,
                   1409: only the escape sequence is discarded.
                   1410: The characters preceding it are used as the request or macro name,
                   1411: the characters following it are used as the arguments to the request or macro.
                   1412: .It Sy "argument count wrong"
                   1413: .Pq mdoc , man , roff
                   1414: The indicated request or macro has too few or too many arguments.
                   1415: The syntax tree will contain the wrong number of arguments as given.
                   1416: Formatting behaviour depends on the specific request or macro in question.
                   1417: Note that the same message may also occur as a WARNING, see above.
1.124     schwarze 1418: .It Sy "NOT IMPLEMENTED: Bd -file"
                   1419: .Pq mdoc
                   1420: For security reasons, the
                   1421: .Ic \&Bd
                   1422: macro does not support the
                   1423: .Fl file
                   1424: argument.
                   1425: By requesting the inclusion of a sensitive file, a malicious document
                   1426: might otherwise trick a privileged user into inadvertently displaying
                   1427: the file on the screen, revealing the file content to bystanders.
                   1428: The argument is ignored including the file name following it.
1.106     schwarze 1429: .It Sy "missing list type, using -item"
                   1430: .Pq mdoc
                   1431: A
                   1432: .Ic \&Bl
                   1433: macro fails to specify the list type.
                   1434: .It Sy "missing manual name, using \(dq\(dq"
                   1435: .Pq mdoc
                   1436: The first call to
                   1437: .Ic \&Nm
                   1438: lacks the required argument.
                   1439: .It Sy "uname(3) system call failed, using UNKNOWN"
                   1440: .Pq mdoc
                   1441: The
                   1442: .Ic \&Os
                   1443: macro is called without arguments, and the
                   1444: .Xr uname 3
                   1445: system call failed.
                   1446: As a workaround,
                   1447: .Nm
                   1448: can be compiled with
                   1449: .Sm off
                   1450: .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq .
                   1451: .Sm on
                   1452: .It Sy "unknown standard specifier"
                   1453: .Pq mdoc
                   1454: An
                   1455: .Ic \&St
                   1456: macro has an unknown argument and is discarded.
                   1457: .It Sy "skipping request without numeric argument"
1.118     schwarze 1458: .Pq roff , eqn
1.106     schwarze 1459: An
                   1460: .Ic \&it
1.118     schwarze 1461: request or an
                   1462: .Xr eqn 7
                   1463: .Ic \&size
                   1464: or
                   1465: .Ic \&gsize
                   1466: statement has a non-numeric or negative argument or no argument at all.
                   1467: The invalid request or statement is ignored.
1.106     schwarze 1468: .It Sy "skipping all arguments"
                   1469: .Pq mdoc , man , eqn , roff
                   1470: An
                   1471: .Xr mdoc 7
                   1472: .Ic \&Bt ,
                   1473: .Ic \&Ed ,
                   1474: .Ic \&Ef ,
                   1475: .Ic \&Ek ,
                   1476: .Ic \&El ,
                   1477: .Ic \&Re ,
                   1478: or
                   1479: .Ic \&Ud
                   1480: macro, an
                   1481: .Ic \&It
                   1482: macro in a list that don't support item heads, a
                   1483: .Xr man 7
                   1484: .Ic \&LP ,
                   1485: .Ic \&P ,
                   1486: or
                   1487: .Ic \&PP
                   1488: macro, an
                   1489: .Xr eqn 7
1.120     schwarze 1490: .Ic \&EQ
                   1491: or
1.106     schwarze 1492: .Ic \&EN
                   1493: macro, or a
                   1494: .Xr roff 7
                   1495: .Sq \&..
                   1496: block closing request is invoked with at least one argument.
                   1497: All arguments are ignored.
                   1498: .It Sy "skipping excess arguments"
                   1499: .Pq mdoc , roff
1.77      schwarze 1500: The
1.106     schwarze 1501: .Ic \&Bf
                   1502: macro is invoked with more than one argument, or a request of the
                   1503: .Ic \&de
                   1504: family is invoked with more than two arguments.
                   1505: The excess arguments are ignored.
                   1506: .El
                   1507: .Ss FATAL errors
                   1508: .Bl -ohang
                   1509: .It Sy "input too large"
                   1510: .Pq mdoc , man
                   1511: Currently,
                   1512: .Nm
                   1513: cannot handle input files larger than its arbitrary size limit
                   1514: of 2^31 bytes (2 Gigabytes).
                   1515: Since useful manuals are always small, this is not a problem in practice.
                   1516: Parsing is aborted as soon as the condition is detected.
                   1517: .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
                   1518: .Pq roff
                   1519: For security reasons,
1.77      schwarze 1520: .Nm
1.106     schwarze 1521: allows
                   1522: .Ic \&so
                   1523: file inclusion requests only with relative paths
                   1524: and only without ascending to any parent directory.
                   1525: By requesting the inclusion of a sensitive file, a malicious document
                   1526: might otherwise trick a privileged user into inadvertently displaying
                   1527: the file on the screen, revealing the file content to bystanders.
                   1528: The parser exits immediately.
                   1529: .It Sy ".so request failed"
                   1530: .Pq roff
                   1531: Servicing a
                   1532: .Ic \&so
                   1533: request requires reading an external file.
                   1534: While trying to do so, an
                   1535: .Xr open 2 ,
                   1536: .Xr stat 2 ,
                   1537: or
                   1538: .Xr read 2
                   1539: system call failed.
                   1540: The parser exits immediately.
                   1541: Before showing this message,
                   1542: .Nm
                   1543: always shows another message explaining why the system call failed.
                   1544: .El
1.20      kristaps 1545: .Sh COMPATIBILITY
1.26      kristaps 1546: This section summarises
1.20      kristaps 1547: .Nm
1.76      kristaps 1548: compatibility with GNU troff.
1.32      kristaps 1549: Each input and output format is separately noted.
1.48      kristaps 1550: .Ss ASCII Compatibility
1.37      kristaps 1551: .Bl -bullet -compact
1.29      kristaps 1552: .It
1.87      kristaps 1553: Unrenderable unicode codepoints specified with
1.86      kristaps 1554: .Sq \e[uNNNN]
                   1555: escapes are printed as
                   1556: .Sq \&?
                   1557: in mandoc.
                   1558: In GNU troff, these raise an error.
                   1559: .It
1.49      kristaps 1560: The
1.33      kristaps 1561: .Sq \&Bd \-literal
1.49      kristaps 1562: and
1.32      kristaps 1563: .Sq \&Bd \-unfilled
                   1564: macros of
                   1565: .Xr mdoc 7
                   1566: in
1.58      kristaps 1567: .Fl T Ns Cm ascii
1.32      kristaps 1568: are synonyms, as are \-filled and \-ragged.
1.26      kristaps 1569: .It
1.86      kristaps 1570: In historic GNU troff, the
1.27      kristaps 1571: .Sq \&Pa
1.32      kristaps 1572: .Xr mdoc 7
                   1573: macro does not underline when scoped under an
1.30      kristaps 1574: .Sq \&It
1.57      kristaps 1575: in the FILES section.
                   1576: This behaves correctly in
1.27      kristaps 1577: .Nm .
                   1578: .It
1.58      kristaps 1579: A list or display following the
1.27      kristaps 1580: .Sq \&Ss
1.32      kristaps 1581: .Xr mdoc 7
                   1582: macro in
1.58      kristaps 1583: .Fl T Ns Cm ascii
1.20      kristaps 1584: does not assert a prior vertical break, just as it doesn't with
1.27      kristaps 1585: .Sq \&Sh .
1.20      kristaps 1586: .It
1.32      kristaps 1587: The
                   1588: .Sq \&na
                   1589: .Xr man 7
1.34      kristaps 1590: macro in
1.58      kristaps 1591: .Fl T Ns Cm ascii
1.34      kristaps 1592: has no effect.
1.20      kristaps 1593: .It
                   1594: Words aren't hyphenated.
                   1595: .El
1.114     kristaps 1596: .Ss HTML Compatibility
1.42      kristaps 1597: .Bl -bullet -compact
                   1598: .It
                   1599: The
1.47      kristaps 1600: .Sq \efP
                   1601: escape will revert the font to the previous
                   1602: .Sq \ef
                   1603: escape, not to the last rendered decoration, which is now dictated by
1.57      kristaps 1604: CSS instead of hard-coded.
                   1605: It also will not span past the current scope,
                   1606: for the same reason.
                   1607: Note that in
1.47      kristaps 1608: .Sx ASCII Output
                   1609: mode, this will work fine.
                   1610: .It
                   1611: The
1.42      kristaps 1612: .Xr mdoc 7
                   1613: .Sq \&Bl \-hang
                   1614: and
                   1615: .Sq \&Bl \-tag
                   1616: list types render similarly (no break following overreached left-hand
                   1617: side) due to the expressive constraints of HTML.
                   1618: .It
                   1619: The
                   1620: .Xr man 7
                   1621: .Sq IP
                   1622: and
                   1623: .Sq TP
                   1624: lists render similarly.
                   1625: .El
1.1       kristaps 1626: .Sh SEE ALSO
1.85      kristaps 1627: .Xr eqn 7 ,
1.57      kristaps 1628: .Xr man 7 ,
1.13      kristaps 1629: .Xr mandoc_char 7 ,
1.84      kristaps 1630: .Xr mdoc 7 ,
                   1631: .Xr roff 7 ,
                   1632: .Xr tbl 7
1.1       kristaps 1633: .Sh AUTHORS
                   1634: The
                   1635: .Nm
1.26      kristaps 1636: utility was written by
1.103     schwarze 1637: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.39      kristaps 1638: .Sh CAVEATS
                   1639: In
1.58      kristaps 1640: .Fl T Ns Cm html
1.50      kristaps 1641: and
1.58      kristaps 1642: .Fl T Ns Cm xhtml ,
1.39      kristaps 1643: the maximum size of an element attribute is determined by
                   1644: .Dv BUFSIZ ,
1.57      kristaps 1645: which is usually 1024 bytes.
                   1646: Be aware of this when setting long link
1.58      kristaps 1647: formats such as
                   1648: .Fl O Ns Cm style Ns = Ns Ar really/long/link .
1.51      kristaps 1649: .Pp
                   1650: Nesting elements within next-line element scopes of
1.58      kristaps 1651: .Fl m Ns Cm an ,
1.51      kristaps 1652: such as
                   1653: .Sq br
                   1654: within an empty
                   1655: .Sq B ,
                   1656: will confuse
1.58      kristaps 1657: .Fl T Ns Cm html
1.51      kristaps 1658: and
1.58      kristaps 1659: .Fl T Ns Cm xhtml
1.52      kristaps 1660: and cause them to forget the formatting of the prior next-line scope.
1.53      kristaps 1661: .Pp
1.54      kristaps 1662: The
                   1663: .Sq \(aq
1.55      kristaps 1664: control character is an alias for the standard macro control character
                   1665: and does not emit a line-break as stipulated in GNU troff.

CVSweb