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

Annotation of mandoc/mandoc.1, Revision 1.244

1.243     schwarze    1: .\" $OpenBSD: mandoc.1,v 1.166 2020/02/15 15:28:01 schwarze Exp $
1.1       kristaps    2: .\"
1.243     schwarze    3: .\" Copyright (c) 2012, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
1.92      schwarze    4: .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
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.244   ! schwarze   18: .Dd $Mdocdate: April 24 2020 $
1.14      kristaps   19: .Dt MANDOC 1
1.1       kristaps   20: .Os
                     21: .Sh NAME
                     22: .Nm mandoc
1.181     schwarze   23: .Nd format manual pages
1.1       kristaps   24: .Sh SYNOPSIS
                     25: .Nm mandoc
1.184     schwarze   26: .Op Fl ac
1.156     schwarze   27: .Op Fl I Cm os Ns = Ns Ar name
                     28: .Op Fl K Ar encoding
1.180     schwarze   29: .Op Fl mdoc | man
1.184     schwarze   30: .Op Fl O Ar options
1.156     schwarze   31: .Op Fl T Ar output
                     32: .Op Fl W Ar level
1.89      kristaps   33: .Op Ar
1.1       kristaps   34: .Sh DESCRIPTION
                     35: The
                     36: .Nm
1.224     schwarze   37: utility formats manual pages for display.
1.100     kristaps   38: .Pp
                     39: By default,
                     40: .Nm
                     41: reads
                     42: .Xr mdoc 7
                     43: or
                     44: .Xr man 7
1.180     schwarze   45: text from stdin and produces
1.156     schwarze   46: .Fl T Cm locale
1.100     kristaps   47: output.
                     48: .Pp
1.109     schwarze   49: The options are as follows:
1.19      kristaps   50: .Bl -tag -width Ds
1.107     schwarze   51: .It Fl a
                     52: If the standard output is a terminal device and
                     53: .Fl c
                     54: is not specified, use
                     55: .Xr more 1
                     56: to paginate the output, just like
                     57: .Xr man 1
                     58: would.
                     59: .It Fl c
                     60: Copy the formatted manual pages to the standard output without using
                     61: .Xr more 1
                     62: to paginate them.
                     63: This is the default.
                     64: It can be specified to override
                     65: .Fl a .
1.156     schwarze   66: .It Fl I Cm os Ns = Ns Ar name
1.101     schwarze   67: Override the default operating system
                     68: .Ar name
                     69: for the
                     70: .Xr mdoc 7
1.180     schwarze   71: .Ic \&Os
1.130     schwarze   72: and for the
                     73: .Xr man 7
1.180     schwarze   74: .Ic \&TH
1.101     schwarze   75: macro.
1.156     schwarze   76: .It Fl K Ar encoding
1.119     schwarze   77: Specify the input encoding.
                     78: The supported
                     79: .Ar encoding
                     80: arguments are
                     81: .Cm us-ascii ,
                     82: .Cm iso-8859-1 ,
                     83: and
                     84: .Cm utf-8 .
1.176     schwarze   85: If not specified, autodetection uses the first match in the following
                     86: list:
                     87: .Bl -enum
                     88: .It
                     89: If the first three bytes of the input file are the UTF-8 byte order
                     90: mark (BOM, 0xefbbbf), input is interpreted as
                     91: .Cm utf-8 .
                     92: .It
                     93: If the first or second line of the input file matches the
1.119     schwarze   94: .Sy emacs
                     95: mode line format
                     96: .Pp
                     97: .D1 .\e" -*- Oo ...; Oc coding: Ar encoding ; No -*-
1.176     schwarze   98: .Pp
                     99: then input is interpreted according to
                    100: .Ar encoding .
                    101: .It
                    102: If the first non-ASCII byte in the file introduces a valid UTF-8
                    103: sequence, input is interpreted as
                    104: .Cm utf-8 .
                    105: .It
                    106: Otherwise, input is interpreted as
                    107: .Cm iso-8859-1 .
1.119     schwarze  108: .El
1.180     schwarze  109: .It Fl mdoc | man
                    110: With
                    111: .Fl mdoc ,
                    112: all input files are interpreted as
                    113: .Xr mdoc 7 .
                    114: With
                    115: .Fl man ,
                    116: all input files are interpreted as
                    117: .Xr man 7 .
                    118: By default, the input language is automatically detected for each file:
1.221     schwarze  119: if the first macro is
1.180     schwarze  120: .Ic \&Dd
                    121: or
                    122: .Ic \&Dt ,
                    123: the
                    124: .Xr mdoc 7
                    125: parser is used; otherwise, the
                    126: .Xr man 7
                    127: parser is used.
                    128: With other arguments,
                    129: .Fl m
                    130: is silently ignored.
1.184     schwarze  131: .It Fl O Ar options
1.57      kristaps  132: Comma-separated output options.
1.224     schwarze  133: See the descriptions of the individual output formats for supported
                    134: .Ar options .
1.156     schwarze  135: .It Fl T Ar output
1.224     schwarze  136: Select the output format.
                    137: Supported values for the
                    138: .Ar output
                    139: argument are
                    140: .Cm ascii ,
                    141: .Cm html ,
                    142: the default of
                    143: .Cm locale ,
                    144: .Cm man ,
                    145: .Cm markdown ,
                    146: .Cm pdf ,
                    147: .Cm ps ,
                    148: .Cm tree ,
                    149: and
                    150: .Cm utf8 .
                    151: .Pp
                    152: The special
                    153: .Fl T Cm lint
                    154: mode only parses the input and produces no output.
                    155: It implies
                    156: .Fl W Cm all
                    157: and redirects parser messages, which usually appear on standard
                    158: error output, to standard output.
1.156     schwarze  159: .It Fl W Ar level
1.77      schwarze  160: Specify the minimum message
                    161: .Ar level
                    162: to be reported on the standard error output and to affect the exit status.
                    163: The
                    164: .Ar level
                    165: can be
1.202     schwarze  166: .Cm base ,
1.185     schwarze  167: .Cm style ,
1.133     schwarze  168: .Cm warning ,
                    169: .Cm error ,
1.77      schwarze  170: or
1.202     schwarze  171: .Cm unsupp .
                    172: The
                    173: .Cm base
                    174: level automatically derives the operating system from the contents of the
                    175: .Ic \&Os
                    176: macro, from the
                    177: .Fl Ios
                    178: command line option, or from the
                    179: .Xr uname 3
                    180: return value.
                    181: The levels
                    182: .Cm openbsd
                    183: and
                    184: .Cm netbsd
                    185: are variants of
                    186: .Cm base
                    187: that bypass autodetection and request validation of base system
                    188: conventions for a particular operating system.
                    189: The level
1.132     schwarze  190: .Cm all
1.77      schwarze  191: is an alias for
1.202     schwarze  192: .Cm base .
1.132     schwarze  193: By default,
                    194: .Nm
                    195: is silent.
1.77      schwarze  196: See
                    197: .Sx EXIT STATUS
                    198: and
                    199: .Sx DIAGNOSTICS
                    200: for details.
                    201: .Pp
                    202: The special option
1.156     schwarze  203: .Fl W Cm stop
1.77      schwarze  204: tells
                    205: .Nm
                    206: to exit after parsing a file that causes warnings or errors of at least
                    207: the requested level.
                    208: No formatted output will be produced from that file.
                    209: If both a
                    210: .Ar level
                    211: and
                    212: .Cm stop
                    213: are requested, they can be joined with a comma, for example
1.156     schwarze  214: .Fl W Cm error , Ns Cm stop .
1.58      kristaps  215: .It Ar file
1.224     schwarze  216: Read from the given input file.
                    217: If multiple files are specified, they are processed in the given order.
                    218: If unspecified,
1.2       kristaps  219: .Nm
1.224     schwarze  220: reads from standard input.
1.1       kristaps  221: .El
1.109     schwarze  222: .Pp
1.183     schwarze  223: The options
                    224: .Fl fhklw
1.239     schwarze  225: are also supported and are documented in
                    226: .Xr man 1 .
1.109     schwarze  227: In
                    228: .Fl f
                    229: and
                    230: .Fl k
                    231: mode,
                    232: .Nm
                    233: also supports the options
1.183     schwarze  234: .Fl CMmOSs
1.109     schwarze  235: described in the
                    236: .Xr apropos 1
                    237: manual.
1.182     schwarze  238: The options
                    239: .Fl fkl
                    240: are mutually exclusive and override each other.
1.66      kristaps  241: .Ss ASCII Output
1.224     schwarze  242: Use
1.156     schwarze  243: .Fl T Cm ascii
1.224     schwarze  244: to force text output in 7-bit ASCII character encoding documented in the
                    245: .Xr ascii 7
                    246: manual page, ignoring the
                    247: .Xr locale 1
                    248: set in the environment.
1.66      kristaps  249: .Pp
                    250: Font styles are applied by using back-spaced encoding such that an
                    251: underlined character
                    252: .Sq c
                    253: is rendered as
                    254: .Sq _ Ns \e[bs] Ns c ,
                    255: where
                    256: .Sq \e[bs]
                    257: is the back-space character number 8.
                    258: Emboldened characters are rendered as
                    259: .Sq c Ns \e[bs] Ns c .
1.235     schwarze  260: This markup is typically converted to appropriate terminal sequences by
                    261: the pager or
                    262: .Xr ul 1 .
                    263: To remove the markup, pipe the output to
                    264: .Xr col 1
                    265: .Fl b
                    266: instead.
1.66      kristaps  267: .Pp
                    268: The special characters documented in
                    269: .Xr mandoc_char 7
                    270: are rendered best-effort in an ASCII equivalent.
1.237     schwarze  271: In particular, opening and closing
                    272: .Sq single quotes
                    273: are represented as characters number 0x60 and 0x27, respectively,
                    274: which agrees with all ASCII standards from 1965 to the latest
                    275: revision (2012) and which matches the traditional way in which
                    276: .Xr roff 7
                    277: formatters represent single quotes in ASCII output.
                    278: This correct ASCII rendering may look strange with modern
                    279: Unicode-compatible fonts because contrary to ASCII, Unicode uses
                    280: the code point U+0060 for the grave accent only, never for an opening
                    281: quote.
1.66      kristaps  282: .Pp
                    283: The following
                    284: .Fl O
                    285: arguments are accepted:
1.19      kristaps  286: .Bl -tag -width Ds
1.98      schwarze  287: .It Cm indent Ns = Ns Ar indent
                    288: The left margin for normal text is set to
                    289: .Ar indent
                    290: blank characters instead of the default of five for
                    291: .Xr mdoc 7
                    292: and seven for
                    293: .Xr man 7 .
                    294: Increasing this is not recommended; it may result in degraded formatting,
1.99      schwarze  295: for example overfull lines or ugly line breaks.
1.223     schwarze  296: When output is to a pager on a terminal that is less than 66 columns
                    297: wide, the default is reduced to three columns.
1.218     schwarze  298: .It Cm mdoc
                    299: Format
                    300: .Xr man 7
                    301: input files in
                    302: .Xr mdoc 7
                    303: output style.
                    304: Specifically, this suppresses the two additional blank lines near the
                    305: top and the bottom of each page, and it implies
                    306: .Fl O Cm indent Ns =5 .
                    307: One useful application is for checking that
                    308: .Fl T Cm man
                    309: output formats in the same way as the
                    310: .Xr mdoc 7
                    311: source it was generated from.
1.231     schwarze  312: .It Cm tag Ns Op = Ns Ar term
                    313: If the formatted manual page is opened in a pager,
                    314: go to the definition of the
                    315: .Ar term
                    316: rather than showing the manual page from the beginning.
                    317: If no
                    318: .Ar term
                    319: is specified, reuse the first command line argument that is not a
                    320: .Ar section
                    321: number.
1.236     schwarze  322: If that argument is in
                    323: .Xr apropos 1
                    324: .Ar key Ns = Ns Ar val
                    325: format, only the
                    326: .Ar val
                    327: is used rather than the argument as a whole.
                    328: This is useful for commands like
                    329: .Ql man -akO tag Ic=ulimit
                    330: to search for a keyword and jump right to its definition
                    331: in the matching manual pages.
1.66      kristaps  332: .It Cm width Ns = Ns Ar width
                    333: The output width is set to
1.223     schwarze  334: .Ar width
                    335: instead of the default of 78.
                    336: When output is to a pager on a terminal that is less than 79 columns
                    337: wide, the default is reduced to one less than the terminal width.
                    338: In any case, lines that are output in literal mode are never wrapped
                    339: and may exceed the output width.
1.1       kristaps  340: .El
1.66      kristaps  341: .Ss HTML Output
                    342: Output produced by
1.156     schwarze  343: .Fl T Cm html
1.114     kristaps  344: conforms to HTML5 using optional self-closing tags.
1.116     kristaps  345: Default styles use only CSS1.
                    346: Equations rendered from
                    347: .Xr eqn 7
                    348: blocks use MathML.
1.66      kristaps  349: .Pp
1.234     schwarze  350: The file
                    351: .Pa /usr/share/misc/mandoc.css
                    352: documents style-sheet classes available for customising output.
1.83      kristaps  353: If a style-sheet is not specified with
1.156     schwarze  354: .Fl O Cm style ,
                    355: .Fl T Cm html
1.114     kristaps  356: defaults to simple output (via an embedded style-sheet)
                    357: readable in any graphical or text-based web
1.83      kristaps  358: browser.
1.66      kristaps  359: .Pp
1.224     schwarze  360: Non-ASCII characters are rendered
1.225     schwarze  361: as hexadecimal Unicode character references.
1.66      kristaps  362: .Pp
                    363: The following
1.64      kristaps  364: .Fl O
1.66      kristaps  365: arguments are accepted:
1.37      kristaps  366: .Bl -tag -width Ds
1.94      kristaps  367: .It Cm fragment
1.123     schwarze  368: Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
                    369: elements and only emit the subtree below the <body> element.
1.94      kristaps  370: The
                    371: .Cm style
1.97      schwarze  372: argument will be ignored.
1.94      kristaps  373: This is useful when embedding manual content within existing documents.
1.64      kristaps  374: .It Cm includes Ns = Ns Ar fmt
1.40      kristaps  375: The string
                    376: .Ar fmt ,
1.49      kristaps  377: for example,
1.40      kristaps  378: .Ar ../src/%I.html ,
                    379: is used as a template for linked header files (usually via the
1.180     schwarze  380: .Ic \&In
1.57      kristaps  381: macro).
                    382: Instances of
1.43      kristaps  383: .Sq \&%I
1.57      kristaps  384: are replaced with the include filename.
                    385: The default is not to present a
1.40      kristaps  386: hyperlink.
1.229     schwarze  387: .It Cm man Ns = Ns Ar fmt Ns Op ; Ns Ar fmt
1.39      kristaps  388: The string
                    389: .Ar fmt ,
1.49      kristaps  390: for example,
1.39      kristaps  391: .Ar ../html%S/%N.%S.html ,
                    392: is used as a template for linked manuals (usually via the
1.180     schwarze  393: .Ic \&Xr
1.57      kristaps  394: macro).
                    395: Instances of
1.43      kristaps  396: .Sq \&%N
1.40      kristaps  397: and
                    398: .Sq %S
                    399: are replaced with the linked manual's name and section, respectively.
1.57      kristaps  400: If no section is included, section 1 is assumed.
                    401: The default is not to
1.40      kristaps  402: present a hyperlink.
1.229     schwarze  403: If two formats are given and a file
                    404: .Ar %N.%S
                    405: exists in the current directory, the first format is used;
                    406: otherwise, the second format is used.
1.64      kristaps  407: .It Cm style Ns = Ns Ar style.css
1.58      kristaps  408: The file
                    409: .Ar style.css
                    410: is used for an external style-sheet.
                    411: This must be a valid absolute or
                    412: relative URI.
1.244   ! schwarze  413: .It Cm tag Ns Op = Ns Ar term
        !           414: Same syntax and semantics as for
        !           415: .Sx ASCII Output .
        !           416: This is implemented by passing a
        !           417: .Ic file://
        !           418: URI ending in a fragment identifier to the pager
        !           419: rather than passing merely a file name.
        !           420: When using this argument, use a pager supporting such URIs, for example
        !           421: .Bd -literal -offset 3n
        !           422: MANPAGER='lynx -force_html' man -T html -O tag=MANPAGER man
        !           423: MANPAGER='w3m -T text/html' man -T html -O tag=toc mandoc
        !           424: .Ed
        !           425: .Pp
        !           426: This argument does not work with
        !           427: .Xr more 1
        !           428: or
        !           429: .Xr less 1 .
1.230     schwarze  430: .It Cm toc
                    431: If an input file contains at least two non-standard sections,
                    432: print a table of contents near the beginning of the output.
1.61      kristaps  433: .El
1.93      schwarze  434: .Ss Locale Output
1.224     schwarze  435: By default,
                    436: .Nm
                    437: automatically selects UTF-8 or ASCII output according to the current
                    438: .Xr locale 1 .
                    439: If any of the environment variables
                    440: .Ev LC_ALL ,
                    441: .Ev LC_CTYPE ,
                    442: or
                    443: .Ev LANG
                    444: are set and the first one that is set
                    445: selects the UTF-8 character encoding, it produces
                    446: .Sx UTF-8 Output ;
                    447: otherwise, it falls back to
                    448: .Sx ASCII Output .
                    449: This output mode can also be selected explicitly with
1.156     schwarze  450: .Fl T Cm locale .
1.95      kristaps  451: .Ss Man Output
1.224     schwarze  452: Use
                    453: .Fl T Cm man
                    454: to translate
                    455: .Xr mdoc 7
                    456: input into
1.95      kristaps  457: .Xr man 7
                    458: output format.
1.102     schwarze  459: This is useful for distributing manual sources to legacy systems
1.96      kristaps  460: lacking
1.95      kristaps  461: .Xr mdoc 7
                    462: formatters.
1.242     schwarze  463: Embedded
                    464: .Xr eqn 7
                    465: and
                    466: .Xr tbl 7
                    467: code is not supported.
1.95      kristaps  468: .Pp
1.224     schwarze  469: If the input format of a file is
1.95      kristaps  470: .Xr man 7 ,
1.97      schwarze  471: the input is copied to the output, expanding any
1.95      kristaps  472: .Xr roff 7
1.180     schwarze  473: .Ic so
1.97      schwarze  474: requests.
                    475: The parser is also run, and as usual, the
                    476: .Fl W
                    477: level controls which
                    478: .Sx DIAGNOSTICS
                    479: are displayed before copying the input to the output.
1.175     schwarze  480: .Ss Markdown Output
1.224     schwarze  481: Use
                    482: .Fl T Cm markdown
                    483: to translate
1.175     schwarze  484: .Xr mdoc 7
1.224     schwarze  485: input to the markdown format conforming to
1.175     schwarze  486: .Lk http://daringfireball.net/projects/markdown/syntax.text\
                    487:  "John Gruber's 2004 specification" .
1.178     schwarze  488: The output also almost conforms to the
                    489: .Lk http://commonmark.org/ CommonMark
                    490: specification.
                    491: .Pp
                    492: The character set used for the markdown output is ASCII.
                    493: Non-ASCII characters are encoded as HTML entities.
                    494: Since that is not possible in literal font contexts, because these
                    495: are rendered as code spans and code blocks in the markdown output,
                    496: non-ASCII characters are transliterated to ASCII approximations in
                    497: these contexts.
1.175     schwarze  498: .Pp
                    499: Markdown is a very weak markup language, so all semantic markup is
                    500: lost, and even part of the presentational markup may be lost.
                    501: Do not use this as an intermediate step in converting to HTML;
                    502: instead, use
                    503: .Fl T Cm html
                    504: directly.
                    505: .Pp
                    506: The
                    507: .Xr man 7 ,
                    508: .Xr tbl 7 ,
                    509: and
                    510: .Xr eqn 7
                    511: input languages are not supported by
                    512: .Fl T Cm markdown
                    513: output mode.
1.93      schwarze  514: .Ss PDF Output
                    515: PDF-1.1 output may be generated by
1.156     schwarze  516: .Fl T Cm pdf .
1.93      schwarze  517: See
                    518: .Sx PostScript Output
                    519: for
                    520: .Fl O
                    521: arguments and defaults.
1.62      kristaps  522: .Ss PostScript Output
1.65      kristaps  523: PostScript
                    524: .Qq Adobe-3.0
                    525: Level-2 pages may be generated by
1.156     schwarze  526: .Fl T Cm ps .
1.67      kristaps  527: Output pages default to letter sized and are rendered in the Times font
1.70      kristaps  528: family, 11-point.
                    529: Margins are calculated as 1/9 the page length and width.
1.71      kristaps  530: Line-height is 1.4m.
1.66      kristaps  531: .Pp
                    532: Special characters are rendered as in
                    533: .Sx ASCII Output .
                    534: .Pp
                    535: The following
                    536: .Fl O
                    537: arguments are accepted:
                    538: .Bl -tag -width Ds
                    539: .It Cm paper Ns = Ns Ar name
                    540: The paper size
                    541: .Ar name
                    542: may be one of
1.68      kristaps  543: .Ar a3 ,
                    544: .Ar a4 ,
                    545: .Ar a5 ,
                    546: .Ar legal ,
1.66      kristaps  547: or
                    548: .Ar letter .
1.68      kristaps  549: You may also manually specify dimensions as
                    550: .Ar NNxNN ,
                    551: width by height in millimetres.
                    552: If an unknown value is encountered,
                    553: .Ar letter
                    554: is used.
1.66      kristaps  555: .El
1.224     schwarze  556: .Ss UTF-8 Output
1.93      schwarze  557: Use
1.156     schwarze  558: .Fl T Cm utf8
1.224     schwarze  559: to force text output in UTF-8 multi-byte character encoding,
                    560: ignoring the
                    561: .Xr locale 1
                    562: settings in the environment.
1.73      kristaps  563: See
1.224     schwarze  564: .Sx ASCII Output
                    565: regarding font styles and
                    566: .Fl O
                    567: arguments.
                    568: .Pp
                    569: On operating systems lacking locale or wide character support, and
                    570: on those where the internal character representation is not UCS-4,
                    571: .Nm
                    572: always falls back to
                    573: .Sx ASCII Output .
1.161     schwarze  574: .Ss Syntax tree output
                    575: Use
                    576: .Fl T Cm tree
                    577: to show a human readable representation of the syntax tree.
                    578: It is useful for debugging the source code of manual pages.
1.162     schwarze  579: The exact format is subject to change, so don't write parsers for it.
1.170     schwarze  580: .Pp
                    581: The first paragraph shows meta data found in the
                    582: .Xr mdoc 7
                    583: prologue, on the
                    584: .Xr man 7
                    585: .Ic \&TH
                    586: line, or the fallbacks used.
                    587: .Pp
                    588: In the tree dump, each output line shows one syntax tree node.
1.161     schwarze  589: Child nodes are indented with respect to their parent node.
                    590: The columns are:
                    591: .Pp
                    592: .Bl -enum -compact
                    593: .It
                    594: For macro nodes, the macro name; for text and
                    595: .Xr tbl 7
1.162     schwarze  596: nodes, the content.
                    597: There is a special format for
1.161     schwarze  598: .Xr eqn 7
                    599: nodes.
                    600: .It
                    601: Node type (text, elem, block, head, body, body-end, tail, tbl, eqn).
                    602: .It
                    603: Flags:
                    604: .Bl -dash -compact
                    605: .It
                    606: An opening parenthesis if the node is an opening delimiter.
                    607: .It
                    608: An asterisk if the node starts a new input line.
                    609: .It
                    610: The input line number (starting at one).
                    611: .It
                    612: A colon.
                    613: .It
                    614: The input column number (starting at one).
                    615: .It
                    616: A closing parenthesis if the node is a closing delimiter.
                    617: .It
                    618: A full stop if the node ends a sentence.
1.169     schwarze  619: .It
1.174     schwarze  620: BROKEN if the node is a block broken by another block.
                    621: .It
1.169     schwarze  622: NOSRC if the node is not in the input file,
                    623: but automatically generated from macros.
                    624: .It
                    625: NOPRT if the node is not supposed to generate output
                    626: for any output format.
1.161     schwarze  627: .El
1.174     schwarze  628: .El
                    629: .Pp
                    630: The following
                    631: .Fl O
                    632: argument is accepted:
                    633: .Bl -tag -width Ds
                    634: .It Cm noval
                    635: Skip validation and show the unvalidated syntax tree.
                    636: This can help to find out whether a given behaviour is caused by
                    637: the parser or by the validator.
                    638: Meta data is not available in this case.
1.161     schwarze  639: .El
1.108     schwarze  640: .Sh ENVIRONMENT
                    641: .Bl -tag -width MANPAGER
1.224     schwarze  642: .It Ev LC_CTYPE
                    643: The character encoding
                    644: .Xr locale 1 .
                    645: When
                    646: .Sx Locale Output
                    647: is selected, it decides whether to use ASCII or UTF-8 output format.
                    648: It never affects the interpretation of input files.
1.108     schwarze  649: .It Ev MANPAGER
                    650: Any non-empty value of the environment variable
                    651: .Ev MANPAGER
1.179     schwarze  652: is used instead of the standard pagination program,
                    653: .Xr more 1 ;
                    654: see
                    655: .Xr man 1
                    656: for details.
                    657: Only used if
                    658: .Fl a
                    659: or
                    660: .Fl l
                    661: is specified.
1.108     schwarze  662: .It Ev PAGER
                    663: Specifies the pagination program to use when
                    664: .Ev MANPAGER
                    665: is not defined.
                    666: If neither PAGER nor MANPAGER is defined,
1.159     schwarze  667: .Xr more 1
                    668: .Fl s
1.179     schwarze  669: is used.
                    670: Only used if
                    671: .Fl a
                    672: or
                    673: .Fl l
                    674: is specified.
1.108     schwarze  675: .El
1.77      schwarze  676: .Sh EXIT STATUS
                    677: The
                    678: .Nm
                    679: utility exits with one of the following values, controlled by the message
                    680: .Ar level
                    681: associated with the
                    682: .Fl W
                    683: option:
                    684: .Pp
                    685: .Bl -tag -width Ds -compact
                    686: .It 0
1.202     schwarze  687: No base system convention violations, style suggestions, warnings,
                    688: or errors occurred, or those that did were ignored because they
                    689: were lower than the requested
1.77      schwarze  690: .Ar level .
1.185     schwarze  691: .It 1
1.202     schwarze  692: At least one base system convention violation or style suggestion
                    693: occurred, but no warning or error, and
                    694: .Fl W Cm base
                    695: or
1.185     schwarze  696: .Fl W Cm style
                    697: was specified.
1.77      schwarze  698: .It 2
                    699: At least one warning occurred, but no error, and
1.156     schwarze  700: .Fl W Cm warning
1.202     schwarze  701: or a lower
                    702: .Ar level
                    703: was requested.
1.77      schwarze  704: .It 3
1.133     schwarze  705: At least one parsing error occurred,
                    706: but no unsupported feature was encountered, and
1.156     schwarze  707: .Fl W Cm error
1.185     schwarze  708: or a lower
                    709: .Ar level
                    710: was requested.
1.133     schwarze  711: .It 4
1.134     schwarze  712: At least one unsupported feature was encountered, and
1.185     schwarze  713: .Fl W Cm unsupp
                    714: or a lower
                    715: .Ar level
                    716: was requested.
1.77      schwarze  717: .It 5
                    718: Invalid command line arguments were specified.
                    719: No input files have been read.
                    720: .It 6
1.131     schwarze  721: An operating system error occurred, for example exhaustion
                    722: of memory, file descriptors, or process table entries.
1.240     schwarze  723: Such errors may cause
1.77      schwarze  724: .Nm
                    725: to exit at once, possibly in the middle of parsing or formatting a file.
                    726: .El
                    727: .Pp
                    728: Note that selecting
1.156     schwarze  729: .Fl T Cm lint
1.77      schwarze  730: output mode implies
1.202     schwarze  731: .Fl W Cm all .
1.1       kristaps  732: .Sh EXAMPLES
1.13      kristaps  733: To page manuals to the terminal:
1.1       kristaps  734: .Pp
1.187     schwarze  735: .Dl $ mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8
1.28      kristaps  736: .Pp
1.41      kristaps  737: To produce HTML manuals with
1.234     schwarze  738: .Pa /usr/share/misc/mandoc.css
1.41      kristaps  739: as the style-sheet:
1.38      kristaps  740: .Pp
1.234     schwarze  741: .Dl $ mandoc \-T html -O style=/usr/share/misc/mandoc.css mdoc.7 > mdoc.7.html
1.38      kristaps  742: .Pp
1.28      kristaps  743: To check over a large set of manuals:
                    744: .Pp
1.158     schwarze  745: .Dl $ mandoc \-T lint \(gafind /usr/src -name \e*\e.[1-9]\(ga
1.66      kristaps  746: .Pp
                    747: To produce a series of PostScript manuals for A4 paper:
                    748: .Pp
1.234     schwarze  749: .Dl $ mandoc \-T ps \-O paper=a4 mdoc.7 man.7 > manuals.ps
1.91      schwarze  750: .Pp
                    751: Convert a modern
                    752: .Xr mdoc 7
                    753: manual to the older
                    754: .Xr man 7
                    755: format, for use on systems lacking an
                    756: .Xr mdoc 7
                    757: parser:
                    758: .Pp
1.234     schwarze  759: .Dl $ mandoc \-T man foo.mdoc > foo.man
1.77      schwarze  760: .Sh DIAGNOSTICS
1.106     schwarze  761: Messages displayed by
                    762: .Nm
                    763: follow this format:
1.202     schwarze  764: .Bd -ragged -offset indent
1.205     schwarze  765: .Nm :
1.233     schwarze  766: .Ar file : Ns Ar line : Ns Ar column : level : message : macro arguments
1.202     schwarze  767: .Pq Ar os
                    768: .Ed
1.77      schwarze  769: .Pp
1.233     schwarze  770: The first three fields identify the
                    771: .Ar file
                    772: name,
                    773: .Ar line
                    774: number, and
                    775: .Ar column
                    776: number of the input file where the message was triggered.
                    777: The line and column numbers start at 1.
1.106     schwarze  778: Both are omitted for messages referring to an input file as a whole.
1.233     schwarze  779: All
                    780: .Ar level
                    781: and
                    782: .Ar message
                    783: strings are explained below.
                    784: The name of the
                    785: .Ar macro
                    786: triggering the message and its
                    787: .Ar arguments
                    788: are omitted where meaningless.
1.202     schwarze  789: The
                    790: .Ar os
                    791: operating system specifier is omitted for messages that are relevant
                    792: for all operating systems.
1.106     schwarze  793: Fatal messages about invalid command line arguments
                    794: or operating system errors, for example when memory is exhausted,
                    795: may also omit the
                    796: .Ar file
1.104     schwarze  797: and
1.106     schwarze  798: .Ar level
                    799: fields.
1.104     schwarze  800: .Pp
1.77      schwarze  801: Message levels have the following meanings:
                    802: .Bl -tag -width "warning"
1.240     schwarze  803: .It Cm syserr
                    804: An operating system error occurred.
                    805: There isn't necessarily anything wrong with the input files.
                    806: Output may all the same be missing or incomplete.
                    807: .It Cm badarg
                    808: Invalid command line arguments were specified.
                    809: No input files have been read and no output is produced.
1.133     schwarze  810: .It Cm unsupp
                    811: An input file uses unsupported low-level
                    812: .Xr roff 7
                    813: features.
                    814: The output may be incomplete and/or misformatted,
                    815: so using GNU troff instead of
                    816: .Nm
                    817: to process the file may be preferable.
1.77      schwarze  818: .It Cm error
1.216     schwarze  819: Indicates a risk of information loss or severe misformatting,
                    820: in most cases caused by serious syntax errors.
1.77      schwarze  821: .It Cm warning
1.216     schwarze  822: Indicates a risk that the information shown or its formatting
                    823: may mismatch the author's intent in minor ways.
                    824: Additionally, syntax errors are classified at least as warnings,
                    825: even if they do not usually cause misformatting.
1.185     schwarze  826: .It Cm style
                    827: An input file uses dubious or discouraged style.
                    828: This is not a complaint about the syntax, and probably neither
                    829: formatting nor portability are in danger.
                    830: While great care is taken to avoid false positives on the higher
                    831: message levels, the
                    832: .Cm style
                    833: level tries to reduce the probability that issues go unnoticed,
                    834: so it may occasionally issue bogus suggestions.
                    835: Please use your good judgement to decide whether any particular
                    836: .Cm style
                    837: suggestion really justifies a change to the input file.
1.202     schwarze  838: .It Cm base
1.219     schwarze  839: A convention used in the base system of a specific operating system
1.202     schwarze  840: is not adhered to.
                    841: These are not markup mistakes, and neither the quality of formatting
                    842: nor portability are in danger.
1.214     schwarze  843: Messages of the
                    844: .Cm base
                    845: level are printed with the more intuitive
                    846: .Cm style
                    847: .Ar level
                    848: tag.
1.77      schwarze  849: .El
                    850: .Pp
                    851: Messages of the
1.202     schwarze  852: .Cm base ,
1.185     schwarze  853: .Cm style ,
1.133     schwarze  854: .Cm warning ,
                    855: .Cm error ,
1.77      schwarze  856: and
1.133     schwarze  857: .Cm unsupp
1.240     schwarze  858: levels are hidden unless their level, or a lower level, is requested using a
1.77      schwarze  859: .Fl W
                    860: option or
1.156     schwarze  861: .Fl T Cm lint
1.77      schwarze  862: output mode.
1.202     schwarze  863: .Pp
                    864: As indicated below, all
                    865: .Cm base
                    866: and some
                    867: .Cm style
                    868: checks are only performed if a specific operating system name occurs
                    869: in the arguments of the
                    870: .Fl W
                    871: command line option, of the
1.195     schwarze  872: .Ic \&Os
                    873: macro, of the
                    874: .Fl Ios
                    875: command line option, or, if neither are present, in the return value
                    876: of the
                    877: .Xr uname 3
                    878: function.
1.202     schwarze  879: .Ss Conventions for base system manuals
1.189     schwarze  880: .Bl -ohang
1.200     schwarze  881: .It Sy "Mdocdate found"
                    882: .Pq mdoc , Nx
                    883: The
                    884: .Ic \&Dd
                    885: macro uses CVS
                    886: .Ic Mdocdate
                    887: keyword substitution, which is not supported by the
                    888: .Nx
                    889: base system.
                    890: Consider using the conventional
                    891: .Dq "Month dd, yyyy"
                    892: format instead.
                    893: .It Sy "Mdocdate missing"
                    894: .Pq mdoc , Ox
                    895: The
                    896: .Ic \&Dd
                    897: macro does not use CVS
                    898: .Ic Mdocdate
                    899: keyword substitution, but using it is conventionally expected in the
                    900: .Ox
                    901: base system.
1.204     schwarze  902: .It Sy "unknown architecture"
                    903: .Pq mdoc , Ox , Nx
                    904: The third argument of the
                    905: .Ic \&Dt
                    906: macro does not match any of the architectures this operating system
                    907: is running on.
1.203     schwarze  908: .It Sy "operating system explicitly specified"
                    909: .Pq mdoc , Ox , Nx
                    910: The
                    911: .Ic \&Os
                    912: macro has an argument.
                    913: In the base system, it is conventionally left blank.
1.202     schwarze  914: .It Sy "RCS id missing"
                    915: .Pq Ox , Nx
                    916: The manual page lacks the comment line with the RCS identifier
                    917: generated by CVS
                    918: .Ic OpenBSD
                    919: or
                    920: .Ic NetBSD
                    921: keyword substitution as conventionally used in these operating systems.
1.210     schwarze  922: .It Sy "referenced manual not found"
                    923: .Pq mdoc
                    924: An
                    925: .Ic \&Xr
                    926: macro references a manual page that is not found in the base system.
                    927: The path to look for base system manuals is configurable at compile
                    928: time and defaults to
                    929: .Pa /usr/share/man : /usr/X11R6/man .
1.202     schwarze  930: .El
                    931: .Ss Style suggestions
                    932: .Bl -ohang
1.200     schwarze  933: .It Sy "legacy man(7) date format"
                    934: .Pq mdoc
                    935: The
                    936: .Ic \&Dd
                    937: macro uses the legacy
                    938: .Xr man 7
                    939: date format
                    940: .Dq yyyy-dd-mm .
                    941: Consider using the conventional
                    942: .Xr mdoc 7
                    943: date format
                    944: .Dq "Month dd, yyyy"
                    945: instead.
1.226     schwarze  946: .It Sy "normalizing date format to" : No ...
                    947: .Pq mdoc , man
                    948: The
                    949: .Ic \&Dd
                    950: or
                    951: .Ic \&TH
                    952: macro provides an abbreviated month name or a day number with a
                    953: leading zero.
                    954: In the formatted output, the month name is written out in full
                    955: and the leading zero is omitted.
1.215     schwarze  956: .It Sy "lower case character in document title"
                    957: .Pq mdoc , man
                    958: The title is still used as given in the
                    959: .Ic \&Dt
                    960: or
                    961: .Ic \&TH
                    962: macro.
1.201     schwarze  963: .It Sy "duplicate RCS id"
                    964: A single manual page contains two copies of the RCS identifier for
                    965: the same operating system.
                    966: Consider deleting the later instance and moving the first one up
                    967: to the top of the page.
1.220     schwarze  968: .It Sy "possible typo in section name"
1.207     schwarze  969: .Pq mdoc
                    970: Fuzzy string matching revealed that the argument of an
                    971: .Ic \&Sh
                    972: macro is similar, but not identical to a standard section name.
1.215     schwarze  973: .It Sy "unterminated quoted argument"
                    974: .Pq roff
                    975: Macro arguments can be enclosed in double quote characters
                    976: such that space characters and macro names contained in the quoted
                    977: argument need not be escaped.
                    978: The closing quote of the last argument of a macro can be omitted.
                    979: However, omitting it is not recommended because it makes the code
                    980: harder to read.
1.189     schwarze  981: .It Sy "useless macro"
                    982: .Pq mdoc
                    983: A
                    984: .Ic \&Bt ,
                    985: .Ic \&Tn ,
                    986: or
1.190     schwarze  987: .Ic \&Ud
1.189     schwarze  988: macro was found.
1.190     schwarze  989: Simply delete it: it serves no useful purpose.
1.191     schwarze  990: .It Sy "consider using OS macro"
                    991: .Pq mdoc
                    992: A string was found in plain text or in a
                    993: .Ic \&Bx
                    994: macro that could be represented using
                    995: .Ic \&Ox ,
                    996: .Ic \&Nx ,
                    997: .Ic \&Fx ,
                    998: or
                    999: .Ic \&Dx .
1.195     schwarze 1000: .It Sy "errnos out of order"
                   1001: .Pq mdoc, Nx
                   1002: The
                   1003: .Ic \&Er
                   1004: items in a
                   1005: .Ic \&Bl
                   1006: list are not in alphabetical order.
                   1007: .It Sy "duplicate errno"
                   1008: .Pq mdoc, Nx
                   1009: A
                   1010: .Ic \&Bl
                   1011: list contains two consecutive
                   1012: .Ic \&It
                   1013: entries describing the same
                   1014: .Ic \&Er
                   1015: number.
1.213     schwarze 1016: .It Sy "trailing delimiter"
1.192     schwarze 1017: .Pq mdoc
1.213     schwarze 1018: The last argument of an
                   1019: .Ic \&Ex , \&Fo , \&Nd , \&Nm , \&Os , \&Sh , \&Ss , \&St ,
                   1020: or
                   1021: .Ic \&Sx
                   1022: macro ends with a trailing delimiter.
                   1023: This is usually bad style and often indicates typos.
                   1024: Most likely, the delimiter can be removed.
1.197     schwarze 1025: .It Sy "no blank before trailing delimiter"
1.198     schwarze 1026: .Pq mdoc
1.197     schwarze 1027: The last argument of a macro that supports trailing delimiter
                   1028: arguments is longer than one byte and ends with a trailing delimiter.
                   1029: Consider inserting a blank such that the delimiter becomes a separate
                   1030: argument, thus moving it out of the scope of the macro.
1.215     schwarze 1031: .It Sy "fill mode already enabled, skipping"
                   1032: .Pq man
                   1033: A
                   1034: .Ic \&fi
                   1035: request occurs even though the document is still in fill mode,
                   1036: or already switched back to fill mode.
                   1037: It has no effect.
                   1038: .It Sy "fill mode already disabled, skipping"
                   1039: .Pq man
                   1040: An
                   1041: .Ic \&nf
                   1042: request occurs even though the document already switched to no-fill mode
                   1043: and did not switch back to fill mode yet.
                   1044: It has no effect.
1.222     schwarze 1045: .It Sy "verbatim \(dq--\(dq, maybe consider using \e(em"
                   1046: .Pq mdoc
                   1047: Even though the ASCII output device renders an em-dash as
                   1048: .Qq \-\- ,
                   1049: that is not a good way to write it in an input file
                   1050: because it renders poorly on all other output devices.
1.198     schwarze 1051: .It Sy "function name without markup"
                   1052: .Pq mdoc
                   1053: A word followed by an empty pair of parentheses occurs on a text line.
                   1054: Consider using an
                   1055: .Ic \&Fn
                   1056: or
                   1057: .Ic \&Xr
                   1058: macro.
1.215     schwarze 1059: .It Sy "whitespace at end of input line"
                   1060: .Pq mdoc , man , roff
                   1061: Whitespace at the end of input lines is almost never semantically
                   1062: significant \(em but in the odd case where it might be, it is
                   1063: extremely confusing when reviewing and maintaining documents.
                   1064: .It Sy "bad comment style"
                   1065: .Pq roff
                   1066: Comment lines start with a dot, a backslash, and a double-quote character.
                   1067: The
                   1068: .Nm
                   1069: utility treats the line as a comment line even without the backslash,
                   1070: but leaving out the backslash might not be portable.
1.189     schwarze 1071: .El
1.106     schwarze 1072: .Ss Warnings related to the document prologue
                   1073: .Bl -ohang
                   1074: .It Sy "missing manual title, using UNTITLED"
                   1075: .Pq mdoc
                   1076: A
                   1077: .Ic \&Dt
                   1078: macro has no arguments, or there is no
                   1079: .Ic \&Dt
                   1080: macro before the first non-prologue macro.
                   1081: .It Sy "missing manual title, using \(dq\(dq"
                   1082: .Pq man
                   1083: There is no
                   1084: .Ic \&TH
                   1085: macro, or it has no arguments.
                   1086: .It Sy "missing manual section, using \(dq\(dq"
                   1087: .Pq mdoc , man
                   1088: A
                   1089: .Ic \&Dt
                   1090: or
                   1091: .Ic \&TH
                   1092: macro lacks the mandatory section argument.
                   1093: .It Sy "unknown manual section"
                   1094: .Pq mdoc
                   1095: The section number in a
                   1096: .Ic \&Dt
                   1097: line is invalid, but still used.
1.243     schwarze 1098: .It Sy "filename/section mismatch"
                   1099: .Pq mdoc , man
                   1100: The name of the input file being processed is known and its file
                   1101: name extension starts with a non-zero digit, but the
                   1102: .Ic \&Dt
                   1103: or
                   1104: .Ic \&TH
                   1105: macro contains a
                   1106: .Ar section
                   1107: argument that starts with a different non-zero digit.
                   1108: The
                   1109: .Ar section
                   1110: argument is used as provided anyway.
                   1111: Consider checking whether the file name or the argument need a correction.
1.241     schwarze 1112: .It Sy "missing date, using \(dq\(dq"
1.106     schwarze 1113: .Pq mdoc, man
                   1114: The document was parsed as
                   1115: .Xr mdoc 7
                   1116: and it has no
                   1117: .Ic \&Dd
                   1118: macro, or the
                   1119: .Ic \&Dd
                   1120: macro has no arguments or only empty arguments;
                   1121: or the document was parsed as
                   1122: .Xr man 7
                   1123: and it has no
                   1124: .Ic \&TH
                   1125: macro, or the
                   1126: .Ic \&TH
                   1127: macro has less than three arguments or its third argument is empty.
                   1128: .It Sy "cannot parse date, using it verbatim"
                   1129: .Pq mdoc , man
                   1130: The date given in a
                   1131: .Ic \&Dd
                   1132: or
                   1133: .Ic \&TH
                   1134: macro does not follow the conventional format.
1.212     schwarze 1135: .It Sy "date in the future, using it anyway"
                   1136: .Pq mdoc , man
                   1137: The date given in a
                   1138: .Ic \&Dd
                   1139: or
                   1140: .Ic \&TH
                   1141: macro is more than a day ahead of the current system
                   1142: .Xr time 3 .
1.106     schwarze 1143: .It Sy "missing Os macro, using \(dq\(dq"
                   1144: .Pq mdoc
                   1145: The default or current system is not shown in this case.
                   1146: .It Sy "late prologue macro"
                   1147: .Pq mdoc
                   1148: A
                   1149: .Ic \&Dd
                   1150: or
                   1151: .Ic \&Os
                   1152: macro occurs after some non-prologue macro, but still takes effect.
                   1153: .It Sy "prologue macros out of order"
                   1154: .Pq mdoc
                   1155: The prologue macros are not given in the conventional order
                   1156: .Ic \&Dd ,
                   1157: .Ic \&Dt ,
                   1158: .Ic \&Os .
                   1159: All three macros are used even when given in another order.
                   1160: .El
                   1161: .Ss Warnings regarding document structure
                   1162: .Bl -ohang
                   1163: .It Sy ".so is fragile, better use ln(1)"
                   1164: .Pq roff
                   1165: Including files only works when the parser program runs with the correct
                   1166: current working directory.
                   1167: .It Sy "no document body"
                   1168: .Pq mdoc , man
                   1169: The document body contains neither text nor macros.
                   1170: An empty document is shown, consisting only of a header and a footer line.
                   1171: .It Sy "content before first section header"
                   1172: .Pq mdoc , man
                   1173: Some macros or text precede the first
                   1174: .Ic \&Sh
                   1175: or
                   1176: .Ic \&SH
                   1177: section header.
                   1178: The offending macros and text are parsed and added to the top level
                   1179: of the syntax tree, outside any section block.
                   1180: .It Sy "first section is not NAME"
                   1181: .Pq mdoc
                   1182: The argument of the first
                   1183: .Ic \&Sh
                   1184: macro is not
                   1185: .Sq NAME .
                   1186: This may confuse
                   1187: .Xr makewhatis 8
                   1188: and
                   1189: .Xr apropos 1 .
1.168     schwarze 1190: .It Sy "NAME section without Nm before Nd"
1.106     schwarze 1191: .Pq mdoc
1.155     schwarze 1192: The NAME section does not contain any
                   1193: .Ic \&Nm
1.168     schwarze 1194: child macro before the first
                   1195: .Ic \&Nd
                   1196: macro.
1.155     schwarze 1197: .It Sy "NAME section without description"
                   1198: .Pq mdoc
                   1199: The NAME section lacks the mandatory
                   1200: .Ic \&Nd
                   1201: child macro.
                   1202: .It Sy "description not at the end of NAME"
                   1203: .Pq mdoc
                   1204: The NAME section does contain an
1.106     schwarze 1205: .Ic \&Nd
1.155     schwarze 1206: child macro, but other content follows it.
                   1207: .It Sy "bad NAME section content"
                   1208: .Pq mdoc
                   1209: The NAME section contains plain text or macros other than
                   1210: .Ic \&Nm
1.106     schwarze 1211: and
1.155     schwarze 1212: .Ic \&Nd .
1.168     schwarze 1213: .It Sy "missing comma before name"
                   1214: .Pq mdoc
                   1215: The NAME section contains an
                   1216: .Ic \&Nm
                   1217: macro that is neither the first one nor preceded by a comma.
1.142     schwarze 1218: .It Sy "missing description line, using \(dq\(dq"
                   1219: .Pq mdoc
                   1220: The
                   1221: .Ic \&Nd
                   1222: macro lacks the required argument.
                   1223: The title line of the manual will end after the dash.
1.177     schwarze 1224: .It Sy "description line outside NAME section"
                   1225: .Pq mdoc
                   1226: An
                   1227: .Ic \&Nd
                   1228: macro appears outside the NAME section.
                   1229: The arguments are printed anyway and the following text is used for
                   1230: .Xr apropos 1 ,
                   1231: but none of that behaviour is portable.
1.106     schwarze 1232: .It Sy "sections out of conventional order"
                   1233: .Pq mdoc
                   1234: A standard section occurs after another section it usually precedes.
                   1235: All section titles are used as given,
                   1236: and the order of sections is not changed.
                   1237: .It Sy "duplicate section title"
                   1238: .Pq mdoc
                   1239: The same standard section title occurs more than once.
                   1240: .It Sy "unexpected section"
                   1241: .Pq mdoc
                   1242: A standard section header occurs in a section of the manual
                   1243: where it normally isn't useful.
1.211     schwarze 1244: .It Sy "cross reference to self"
                   1245: .Pq mdoc
                   1246: An
                   1247: .Ic \&Xr
                   1248: macro refers to a name and section matching the section of the present
                   1249: manual page and a name mentioned in an
                   1250: .Ic \&Nm
                   1251: macro in the NAME or SYNOPSIS section, or in an
                   1252: .Ic \&Fn
                   1253: or
                   1254: .Ic \&Fo
                   1255: macro in the SYNOPSIS.
                   1256: Consider using
                   1257: .Ic \&Nm
                   1258: or
                   1259: .Ic \&Fn
                   1260: instead of
                   1261: .Ic \&Xr .
1.112     schwarze 1262: .It Sy "unusual Xr order"
                   1263: .Pq mdoc
                   1264: In the SEE ALSO section, an
                   1265: .Ic \&Xr
                   1266: macro with a lower section number follows one with a higher number,
                   1267: or two
                   1268: .Ic \&Xr
1.157     schwarze 1269: macros referring to the same section are out of alphabetical order.
1.112     schwarze 1270: .It Sy "unusual Xr punctuation"
                   1271: .Pq mdoc
                   1272: In the SEE ALSO section, punctuation between two
                   1273: .Ic \&Xr
                   1274: macros differs from a single comma, or there is trailing punctuation
                   1275: after the last
                   1276: .Ic \&Xr
                   1277: macro.
1.111     schwarze 1278: .It Sy "AUTHORS section without An macro"
                   1279: .Pq mdoc
                   1280: An AUTHORS sections contains no
                   1281: .Ic \&An
                   1282: macros, or only empty ones.
                   1283: Probably, there are author names lacking markup.
1.106     schwarze 1284: .El
                   1285: .Ss "Warnings related to macros and nesting"
                   1286: .Bl -ohang
                   1287: .It Sy "obsolete macro"
                   1288: .Pq mdoc
                   1289: See the
                   1290: .Xr mdoc 7
                   1291: manual for replacements.
1.126     schwarze 1292: .It Sy "macro neither callable nor escaped"
                   1293: .Pq mdoc
                   1294: The name of a macro that is not callable appears on a macro line.
                   1295: It is printed verbatim.
1.152     schwarze 1296: If the intention is to call it, move it to its own input line;
1.126     schwarze 1297: otherwise, escape it by prepending
                   1298: .Sq \e& .
1.106     schwarze 1299: .It Sy "skipping paragraph macro"
                   1300: In
                   1301: .Xr mdoc 7
                   1302: documents, this happens
                   1303: .Bl -dash -compact
                   1304: .It
                   1305: at the beginning and end of sections and subsections
                   1306: .It
                   1307: right before non-compact lists and displays
                   1308: .It
                   1309: at the end of items in non-column, non-compact lists
                   1310: .It
                   1311: and for multiple consecutive paragraph macros.
                   1312: .El
                   1313: In
                   1314: .Xr man 7
                   1315: documents, it happens
                   1316: .Bl -dash -compact
                   1317: .It
                   1318: for empty
                   1319: .Ic \&P ,
                   1320: .Ic \&PP ,
                   1321: and
                   1322: .Ic \&LP
                   1323: macros
                   1324: .It
                   1325: for
                   1326: .Ic \&IP
                   1327: macros having neither head nor body arguments
                   1328: .It
                   1329: for
                   1330: .Ic \&br
                   1331: or
                   1332: .Ic \&sp
                   1333: right after
                   1334: .Ic \&SH
                   1335: or
                   1336: .Ic \&SS
                   1337: .El
                   1338: .It Sy "moving paragraph macro out of list"
                   1339: .Pq mdoc
                   1340: A list item in a
                   1341: .Ic \&Bl
                   1342: list contains a trailing paragraph macro.
                   1343: The paragraph macro is moved after the end of the list.
                   1344: .It Sy "skipping no-space macro"
                   1345: .Pq mdoc
                   1346: An input line begins with an
                   1347: .Ic \&Ns
1.208     schwarze 1348: macro, or the next argument after an
                   1349: .Ic \&Ns
                   1350: macro is an isolated closing delimiter.
1.106     schwarze 1351: The macro is ignored.
                   1352: .It Sy "blocks badly nested"
                   1353: .Pq mdoc
                   1354: If two blocks intersect, one should completely contain the other.
                   1355: Otherwise, rendered output is likely to look strange in any output
                   1356: format, and rendering in SGML-based output formats is likely to be
                   1357: outright wrong because such languages do not support badly nested
                   1358: blocks at all.
                   1359: Typical examples of badly nested blocks are
                   1360: .Qq Ic \&Ao \&Bo \&Ac \&Bc
                   1361: and
                   1362: .Qq Ic \&Ao \&Bq \&Ac .
                   1363: In these examples,
                   1364: .Ic \&Ac
                   1365: breaks
                   1366: .Ic \&Bo
                   1367: and
                   1368: .Ic \&Bq ,
                   1369: respectively.
                   1370: .It Sy "nested displays are not portable"
                   1371: .Pq mdoc
                   1372: A
                   1373: .Ic \&Bd ,
                   1374: .Ic \&D1 ,
                   1375: or
                   1376: .Ic \&Dl
                   1377: display occurs nested inside another
                   1378: .Ic \&Bd
                   1379: display.
                   1380: This works with
                   1381: .Nm ,
                   1382: but fails with most other implementations.
                   1383: .It Sy "moving content out of list"
                   1384: .Pq mdoc
                   1385: A
                   1386: .Ic \&Bl
                   1387: list block contains text or macros before the first
                   1388: .Ic \&It
                   1389: macro.
                   1390: The offending children are moved before the beginning of the list.
1.209     schwarze 1391: .It Sy "first macro on line"
                   1392: Inside a
                   1393: .Ic \&Bl Fl column
                   1394: list, a
                   1395: .Ic \&Ta
                   1396: macro occurs as the first macro on a line, which is not portable.
1.106     schwarze 1397: .It Sy "line scope broken"
                   1398: .Pq man
                   1399: While parsing the next-line scope of the previous macro,
                   1400: another macro is found that prematurely terminates the previous one.
                   1401: The previous, interrupted macro is deleted from the parse tree.
                   1402: .El
                   1403: .Ss "Warnings related to missing arguments"
                   1404: .Bl -ohang
                   1405: .It Sy "skipping empty request"
1.118     schwarze 1406: .Pq roff , eqn
                   1407: The macro name is missing from a macro definition request,
                   1408: or an
                   1409: .Xr eqn 7
                   1410: control statement or operation keyword lacks its required argument.
1.106     schwarze 1411: .It Sy "conditional request controls empty scope"
                   1412: .Pq roff
                   1413: A conditional request is only useful if any of the following
                   1414: follows it on the same logical input line:
                   1415: .Bl -dash -compact
                   1416: .It
                   1417: The
                   1418: .Sq \e{
                   1419: keyword to open a multi-line scope.
                   1420: .It
                   1421: A request or macro or some text, resulting in a single-line scope.
                   1422: .It
                   1423: The immediate end of the logical line without any intervening whitespace,
                   1424: resulting in next-line scope.
                   1425: .El
                   1426: Here, a conditional request is followed by trailing whitespace only,
                   1427: and there is no other content on its logical input line.
                   1428: Note that it doesn't matter whether the logical input line is split
                   1429: across multiple physical input lines using
                   1430: .Sq \e
                   1431: line continuation characters.
                   1432: This is one of the rare cases
                   1433: where trailing whitespace is syntactically significant.
                   1434: The conditional request controls a scope containing whitespace only,
                   1435: so it is unlikely to have a significant effect,
                   1436: except that it may control a following
                   1437: .Ic \&el
                   1438: clause.
                   1439: .It Sy "skipping empty macro"
                   1440: .Pq mdoc
1.147     schwarze 1441: The indicated macro has no arguments and hence no effect.
                   1442: .It Sy "empty block"
                   1443: .Pq mdoc , man
                   1444: A
                   1445: .Ic \&Bd ,
                   1446: .Ic \&Bk ,
                   1447: .Ic \&Bl ,
                   1448: .Ic \&D1 ,
                   1449: .Ic \&Dl ,
1.206     schwarze 1450: .Ic \&MT ,
1.147     schwarze 1451: .Ic \&RS ,
                   1452: or
                   1453: .Ic \&UR
                   1454: block contains nothing in its body and will produce no output.
1.106     schwarze 1455: .It Sy "empty argument, using 0n"
                   1456: .Pq mdoc
                   1457: The required width is missing after
                   1458: .Ic \&Bd
                   1459: or
                   1460: .Ic \&Bl
                   1461: .Fl offset
                   1462: or
1.186     schwarze 1463: .Fl width .
1.106     schwarze 1464: .It Sy "missing display type, using -ragged"
                   1465: .Pq mdoc
                   1466: The
                   1467: .Ic \&Bd
                   1468: macro is invoked without the required display type.
                   1469: .It Sy "list type is not the first argument"
                   1470: .Pq mdoc
                   1471: In a
                   1472: .Ic \&Bl
                   1473: macro, at least one other argument precedes the type argument.
                   1474: The
                   1475: .Nm
                   1476: utility copes with any argument order, but some other
                   1477: .Xr mdoc 7
                   1478: implementations do not.
                   1479: .It Sy "missing -width in -tag list, using 8n"
                   1480: .Pq mdoc
                   1481: Every
                   1482: .Ic \&Bl
                   1483: macro having the
                   1484: .Fl tag
                   1485: argument requires
                   1486: .Fl width ,
                   1487: too.
                   1488: .It Sy "missing utility name, using \(dq\(dq"
                   1489: .Pq mdoc
                   1490: The
                   1491: .Ic \&Ex Fl std
                   1492: macro is called without an argument before
                   1493: .Ic \&Nm
                   1494: has first been called with an argument.
1.146     schwarze 1495: .It Sy "missing function name, using \(dq\(dq"
                   1496: .Pq mdoc
                   1497: The
                   1498: .Ic \&Fo
                   1499: macro is called without an argument.
                   1500: No function name is printed.
1.106     schwarze 1501: .It Sy "empty head in list item"
                   1502: .Pq mdoc
                   1503: In a
                   1504: .Ic \&Bl
                   1505: .Fl diag ,
                   1506: .Fl hang ,
                   1507: .Fl inset ,
                   1508: .Fl ohang ,
                   1509: or
                   1510: .Fl tag
                   1511: list, an
                   1512: .Ic \&It
                   1513: macro lacks the required argument.
                   1514: The item head is left empty.
                   1515: .It Sy "empty list item"
                   1516: .Pq mdoc
                   1517: In a
                   1518: .Ic \&Bl
                   1519: .Fl bullet ,
                   1520: .Fl dash ,
                   1521: .Fl enum ,
                   1522: or
                   1523: .Fl hyphen
                   1524: list, an
                   1525: .Ic \&It
                   1526: block is empty.
                   1527: An empty list item is shown.
1.209     schwarze 1528: .It Sy "missing argument, using next line"
                   1529: .Pq mdoc
                   1530: An
                   1531: .Ic \&It
                   1532: macro in a
                   1533: .Ic \&Bd Fl column
                   1534: list has no arguments.
                   1535: While
                   1536: .Nm
                   1537: uses the text or macros of the following line, if any, for the cell,
                   1538: other formatters may misformat the list.
1.152     schwarze 1539: .It Sy "missing font type, using \efR"
1.106     schwarze 1540: .Pq mdoc
                   1541: A
                   1542: .Ic \&Bf
                   1543: macro has no argument.
1.152     schwarze 1544: It switches to the default font.
                   1545: .It Sy "unknown font type, using \efR"
1.106     schwarze 1546: .Pq mdoc
                   1547: The
                   1548: .Ic \&Bf
                   1549: argument is invalid.
1.152     schwarze 1550: The default font is used instead.
1.127     schwarze 1551: .It Sy "nothing follows prefix"
                   1552: .Pq mdoc
                   1553: A
                   1554: .Ic \&Pf
                   1555: macro has no argument, or only one argument and no macro follows
                   1556: on the same input line.
                   1557: This defeats its purpose; in particular, spacing is not suppressed
                   1558: before the text or macros following on the next input line.
1.143     schwarze 1559: .It Sy "empty reference block"
                   1560: .Pq mdoc
                   1561: An
                   1562: .Ic \&Rs
                   1563: macro is immediately followed by an
                   1564: .Ic \&Re
                   1565: macro on the next input line.
                   1566: Such an empty block does not produce any output.
1.165     schwarze 1567: .It Sy "missing section argument"
                   1568: .Pq mdoc
                   1569: An
                   1570: .Ic \&Xr
                   1571: macro lacks its second, section number argument.
                   1572: The first argument, i.e. the name, is printed, but without subsequent
1.166     schwarze 1573: parentheses.
1.106     schwarze 1574: .It Sy "missing -std argument, adding it"
                   1575: .Pq mdoc
                   1576: An
                   1577: .Ic \&Ex
                   1578: or
                   1579: .Ic \&Rv
                   1580: macro lacks the required
                   1581: .Fl std
                   1582: argument.
                   1583: The
                   1584: .Nm
                   1585: utility assumes
                   1586: .Fl std
                   1587: even when it is not specified, but other implementations may not.
1.150     schwarze 1588: .It Sy "missing option string, using \(dq\(dq"
                   1589: .Pq man
                   1590: The
                   1591: .Ic \&OP
                   1592: macro is invoked without any argument.
                   1593: An empty pair of square brackets is shown.
                   1594: .It Sy "missing resource identifier, using \(dq\(dq"
                   1595: .Pq man
                   1596: The
1.206     schwarze 1597: .Ic \&MT
                   1598: or
1.150     schwarze 1599: .Ic \&UR
                   1600: macro is invoked without any argument.
                   1601: An empty pair of angle brackets is shown.
1.118     schwarze 1602: .It Sy "missing eqn box, using \(dq\(dq"
                   1603: .Pq eqn
                   1604: A diacritic mark or a binary operator is found,
                   1605: but there is nothing to the left of it.
                   1606: An empty box is inserted.
1.106     schwarze 1607: .El
                   1608: .Ss "Warnings related to bad macro arguments"
                   1609: .Bl -ohang
                   1610: .It Sy "duplicate argument"
                   1611: .Pq mdoc
                   1612: A
                   1613: .Ic \&Bd
                   1614: or
                   1615: .Ic \&Bl
                   1616: macro has more than one
                   1617: .Fl compact ,
                   1618: more than one
                   1619: .Fl offset ,
                   1620: or more than one
                   1621: .Fl width
                   1622: argument.
                   1623: All but the last instances of these arguments are ignored.
                   1624: .It Sy "skipping duplicate argument"
                   1625: .Pq mdoc
                   1626: An
                   1627: .Ic \&An
                   1628: macro has more than one
                   1629: .Fl split
                   1630: or
                   1631: .Fl nosplit
                   1632: argument.
                   1633: All but the first of these arguments are ignored.
                   1634: .It Sy "skipping duplicate display type"
                   1635: .Pq mdoc
                   1636: A
                   1637: .Ic \&Bd
                   1638: macro has more than one type argument; the first one is used.
                   1639: .It Sy "skipping duplicate list type"
                   1640: .Pq mdoc
                   1641: A
                   1642: .Ic \&Bl
                   1643: macro has more than one type argument; the first one is used.
                   1644: .It Sy "skipping -width argument"
                   1645: .Pq mdoc
                   1646: A
                   1647: .Ic \&Bl
                   1648: .Fl column ,
                   1649: .Fl diag ,
                   1650: .Fl ohang ,
                   1651: .Fl inset ,
                   1652: or
                   1653: .Fl item
                   1654: list has a
                   1655: .Fl width
                   1656: argument.
                   1657: That has no effect.
1.151     schwarze 1658: .It Sy "wrong number of cells"
                   1659: In a line of a
                   1660: .Ic \&Bl Fl column
                   1661: list, the number of tabs or
                   1662: .Ic \&Ta
                   1663: macros is less than the number expected from the list header line
                   1664: or exceeds the expected number by more than one.
                   1665: Missing cells remain empty, and all cells exceeding the number of
                   1666: columns are joined into one single cell.
1.106     schwarze 1667: .It Sy "unknown AT&T UNIX version"
                   1668: .Pq mdoc
                   1669: An
                   1670: .Ic \&At
                   1671: macro has an invalid argument.
                   1672: It is used verbatim, with
                   1673: .Qq "AT&T UNIX "
                   1674: prefixed to it.
1.113     schwarze 1675: .It Sy "comma in function argument"
                   1676: .Pq mdoc
                   1677: An argument of an
                   1678: .Ic \&Fa
                   1679: or
                   1680: .Ic \&Fn
                   1681: macro contains a comma; it should probably be split into two arguments.
1.117     schwarze 1682: .It Sy "parenthesis in function name"
                   1683: .Pq mdoc
                   1684: The first argument of an
                   1685: .Ic \&Fc
                   1686: or
                   1687: .Ic \&Fn
                   1688: macro contains an opening or closing parenthesis; that's probably wrong,
                   1689: parentheses are added automatically.
1.196     schwarze 1690: .It Sy "unknown library name"
                   1691: .Pq mdoc, not on Ox
                   1692: An
                   1693: .Ic \&Lb
                   1694: macro has an unknown name argument and will be rendered as
                   1695: .Qq library Dq Ar name .
1.106     schwarze 1696: .It Sy "invalid content in Rs block"
                   1697: .Pq mdoc
                   1698: An
                   1699: .Ic \&Rs
                   1700: block contains plain text or non-% macros.
                   1701: The bogus content is left in the syntax tree.
                   1702: Formatting may be poor.
                   1703: .It Sy "invalid Boolean argument"
                   1704: .Pq mdoc
                   1705: An
                   1706: .Ic \&Sm
                   1707: macro has an argument other than
                   1708: .Cm on
                   1709: or
                   1710: .Cm off .
                   1711: The invalid argument is moved out of the macro, which leaves the macro
                   1712: empty, causing it to toggle the spacing mode.
1.228     schwarze 1713: .It Sy "argument contains two font escapes"
                   1714: .Pq roff
                   1715: The second argument of a
                   1716: .Ic char
                   1717: request contains more than one font escape sequence.
                   1718: A wrong font may remain active after using the character.
1.106     schwarze 1719: .It Sy "unknown font, skipping request"
1.115     schwarze 1720: .Pq man , tbl
1.106     schwarze 1721: A
                   1722: .Xr roff 7
                   1723: .Ic \&ft
1.115     schwarze 1724: request or a
                   1725: .Xr tbl 7
                   1726: .Ic \&f
                   1727: layout modifier has an unknown
                   1728: .Ar font
                   1729: argument.
1.151     schwarze 1730: .It Sy "odd number of characters in request"
                   1731: .Pq roff
                   1732: A
                   1733: .Ic \&tr
                   1734: request contains an odd number of characters.
                   1735: The last character is mapped to the blank character.
1.106     schwarze 1736: .El
                   1737: .Ss "Warnings related to plain text"
                   1738: .Bl -ohang
                   1739: .It Sy "blank line in fill mode, using .sp"
                   1740: .Pq mdoc
                   1741: The meaning of blank input lines is only well-defined in non-fill mode:
                   1742: In fill mode, line breaks of text input lines are not supposed to be
                   1743: significant.
                   1744: However, for compatibility with groff, blank lines in fill mode
1.238     schwarze 1745: are formatted like
1.106     schwarze 1746: .Ic \&sp
                   1747: requests.
1.238     schwarze 1748: To request a paragraph break, use
                   1749: .Ic \&Pp
                   1750: instead of a blank line.
1.106     schwarze 1751: .It Sy "tab in filled text"
                   1752: .Pq mdoc , man
                   1753: The meaning of tab characters is only well-defined in non-fill mode:
                   1754: In fill mode, whitespace is not supposed to be significant
                   1755: on text input lines.
                   1756: As an implementation dependent choice, tab characters on text lines
                   1757: are passed through to the formatters in any case.
                   1758: Given that the text before the tab character will be filled,
                   1759: it is hard to predict which tab stop position the tab will advance to.
1.172     schwarze 1760: .It Sy "new sentence, new line"
                   1761: .Pq mdoc
                   1762: A new sentence starts in the middle of a text line.
                   1763: Start it on a new input line to help formatters produce correct spacing.
1.106     schwarze 1764: .It Sy "invalid escape sequence"
                   1765: .Pq roff
                   1766: An escape sequence has an invalid opening argument delimiter, lacks the
1.232     schwarze 1767: closing argument delimiter, the argument is of an invalid form, or it is
                   1768: a character escape sequence with an invalid name.
1.106     schwarze 1769: If the argument is incomplete,
                   1770: .Ic \e*
                   1771: and
                   1772: .Ic \en
                   1773: expand to an empty string,
                   1774: .Ic \eB
                   1775: to the digit
                   1776: .Sq 0 ,
                   1777: and
                   1778: .Ic \ew
                   1779: to the length of the incomplete argument.
                   1780: All other invalid escape sequences are ignored.
1.232     schwarze 1781: .It Sy "undefined escape, printing literally"
                   1782: .Pq roff
                   1783: In an escape sequence, the first character
                   1784: right after the leading backslash is invalid.
                   1785: That character is printed literally,
                   1786: which is equivalent to ignoring the backslash.
1.106     schwarze 1787: .It Sy "undefined string, using \(dq\(dq"
                   1788: .Pq roff
                   1789: If a string is used without being defined before,
                   1790: its value is implicitly set to the empty string.
                   1791: However, defining strings explicitly before use
                   1792: keeps the code more readable.
                   1793: .El
1.138     schwarze 1794: .Ss "Warnings related to tables"
                   1795: .Bl -ohang
                   1796: .It Sy "tbl line starts with span"
                   1797: .Pq tbl
                   1798: The first cell in a table layout line is a horizontal span
                   1799: .Pq Sq Cm s .
                   1800: Data provided for this cell is ignored, and nothing is printed in the cell.
                   1801: .It Sy "tbl column starts with span"
                   1802: .Pq tbl
                   1803: The first line of a table layout specification
                   1804: requests a vertical span
                   1805: .Pq Sq Cm ^ .
                   1806: Data provided for this cell is ignored, and nothing is printed in the cell.
                   1807: .It Sy "skipping vertical bar in tbl layout"
                   1808: .Pq tbl
                   1809: A table layout specification contains more than two consecutive vertical bars.
                   1810: A double bar is printed, all additional bars are discarded.
1.106     schwarze 1811: .El
                   1812: .Ss "Errors related to tables"
1.136     schwarze 1813: .Bl -ohang
                   1814: .It Sy "non-alphabetic character in tbl options"
                   1815: .Pq tbl
                   1816: The table options line contains a character other than a letter,
                   1817: blank, or comma where the beginning of an option name is expected.
                   1818: The character is ignored.
                   1819: .It Sy "skipping unknown tbl option"
                   1820: .Pq tbl
                   1821: The table options line contains a string of letters that does not
                   1822: match any known option name.
                   1823: The word is ignored.
                   1824: .It Sy "missing tbl option argument"
                   1825: .Pq tbl
                   1826: A table option that requires an argument is not followed by an
                   1827: opening parenthesis, or the opening parenthesis is immediately
                   1828: followed by a closing parenthesis.
                   1829: The option is ignored.
                   1830: .It Sy "wrong tbl option argument size"
                   1831: .Pq tbl
                   1832: A table option argument contains an invalid number of characters.
                   1833: Both the option and the argument are ignored.
1.138     schwarze 1834: .It Sy "empty tbl layout"
                   1835: .Pq tbl
                   1836: A table layout specification is completely empty,
                   1837: specifying zero lines and zero columns.
                   1838: As a fallback, a single left-justified column is used.
                   1839: .It Sy "invalid character in tbl layout"
                   1840: .Pq tbl
                   1841: A table layout specification contains a character that can neither
                   1842: be interpreted as a layout key character nor as a layout modifier,
                   1843: or a modifier precedes the first key.
                   1844: The invalid character is discarded.
                   1845: .It Sy "unmatched parenthesis in tbl layout"
                   1846: .Pq tbl
                   1847: A table layout specification contains an opening parenthesis,
                   1848: but no matching closing parenthesis.
                   1849: The rest of the input line, starting from the parenthesis, has no effect.
1.139     schwarze 1850: .It Sy "tbl without any data cells"
                   1851: .Pq tbl
                   1852: A table does not contain any data cells.
                   1853: It will probably produce no output.
                   1854: .It Sy "ignoring data in spanned tbl cell"
                   1855: .Pq tbl
                   1856: A table cell is marked as a horizontal span
                   1857: .Pq Sq Cm s
                   1858: or vertical span
                   1859: .Pq Sq Cm ^
                   1860: in the table layout, but it contains data.
                   1861: The data is ignored.
                   1862: .It Sy "ignoring extra tbl data cells"
                   1863: .Pq tbl
                   1864: A data line contains more cells than the corresponding layout line.
                   1865: The data in the extra cells is ignored.
                   1866: .It Sy "data block open at end of tbl"
                   1867: .Pq tbl
                   1868: A data block is opened with
                   1869: .Cm T{ ,
                   1870: but never closed with a matching
                   1871: .Cm T} .
                   1872: The remaining data lines of the table are all put into one cell,
                   1873: and any remaining cells stay empty.
1.106     schwarze 1874: .El
                   1875: .Ss "Errors related to roff, mdoc, and man code"
                   1876: .Bl -ohang
1.215     schwarze 1877: .It Sy "duplicate prologue macro"
                   1878: .Pq mdoc
                   1879: One of the prologue macros occurs more than once.
                   1880: The last instance overrides all previous ones.
                   1881: .It Sy "skipping late title macro"
                   1882: .Pq mdoc
                   1883: The
                   1884: .Ic \&Dt
                   1885: macro appears after the first non-prologue macro.
                   1886: Traditional formatters cannot handle this because
                   1887: they write the page header before parsing the document body.
                   1888: Even though this technical restriction does not apply to
                   1889: .Nm ,
                   1890: traditional semantics is preserved.
                   1891: The late macro is discarded including its arguments.
1.106     schwarze 1892: .It Sy "input stack limit exceeded, infinite loop?"
                   1893: .Pq roff
                   1894: Explicit recursion limits are implemented for the following features,
                   1895: in order to prevent infinite loops:
                   1896: .Bl -dash -compact
                   1897: .It
                   1898: expansion of nested escape sequences
                   1899: including expansion of strings and number registers,
                   1900: .It
                   1901: expansion of nested user-defined macros,
                   1902: .It
                   1903: and
                   1904: .Ic \&so
                   1905: file inclusion.
                   1906: .El
                   1907: When a limit is hit, the output is incorrect, typically losing
                   1908: some content, but the parser can continue.
                   1909: .It Sy "skipping bad character"
                   1910: .Pq mdoc , man , roff
                   1911: The input file contains a byte that is not a printable
                   1912: .Xr ascii 7
                   1913: character.
                   1914: The message mentions the character number.
                   1915: The offending byte is replaced with a question mark
                   1916: .Pq Sq \&? .
                   1917: Consider editing the input file to replace the byte with an ASCII
                   1918: transliteration of the intended character.
                   1919: .It Sy "skipping unknown macro"
                   1920: .Pq mdoc , man , roff
                   1921: The first identifier on a request or macro line is neither recognized as a
                   1922: .Xr roff 7
                   1923: request, nor as a user-defined macro, nor, respectively, as an
                   1924: .Xr mdoc 7
                   1925: or
                   1926: .Xr man 7
                   1927: macro.
                   1928: It may be mistyped or unsupported.
                   1929: The request or macro is discarded including its arguments.
1.227     schwarze 1930: .It Sy "skipping request outside macro"
                   1931: .Pq roff
                   1932: A
                   1933: .Ic shift
                   1934: or
                   1935: .Ic return
                   1936: request occurs outside any macro definition and has no effect.
1.133     schwarze 1937: .It Sy "skipping insecure request"
                   1938: .Pq roff
                   1939: An input file attempted to run a shell command
                   1940: or to read or write an external file.
                   1941: Such attempts are denied for security reasons.
1.106     schwarze 1942: .It Sy "skipping item outside list"
1.118     schwarze 1943: .Pq mdoc , eqn
1.106     schwarze 1944: An
                   1945: .Ic \&It
                   1946: macro occurs outside any
                   1947: .Ic \&Bl
1.118     schwarze 1948: list, or an
                   1949: .Xr eqn 7
                   1950: .Ic above
                   1951: delimiter occurs outside any pile.
1.106     schwarze 1952: It is discarded including its arguments.
                   1953: .It Sy "skipping column outside column list"
                   1954: .Pq mdoc
                   1955: A
                   1956: .Ic \&Ta
                   1957: macro occurs outside any
                   1958: .Ic \&Bl Fl column
                   1959: block.
                   1960: It is discarded including its arguments.
                   1961: .It Sy "skipping end of block that is not open"
                   1962: .Pq mdoc , man , eqn , tbl , roff
                   1963: Various syntax elements can only be used to explicitly close blocks
                   1964: that have previously been opened.
                   1965: An
                   1966: .Xr mdoc 7
                   1967: block closing macro, a
                   1968: .Xr man 7
1.206     schwarze 1969: .Ic \&ME , \&RE
1.106     schwarze 1970: or
                   1971: .Ic \&UE
1.118     schwarze 1972: macro, an
                   1973: .Xr eqn 7
                   1974: right delimiter or closing brace, or the end of an equation, table, or
1.106     schwarze 1975: .Xr roff 7
                   1976: conditional request is encountered but no matching block is open.
                   1977: The offending request or macro is discarded.
1.135     schwarze 1978: .It Sy "fewer RS blocks open, skipping"
                   1979: .Pq man
                   1980: The
                   1981: .Ic \&RE
                   1982: macro is invoked with an argument, but less than the specified number of
                   1983: .Ic \&RS
                   1984: blocks is open.
                   1985: The
                   1986: .Ic \&RE
                   1987: macro is discarded.
1.106     schwarze 1988: .It Sy "inserting missing end of block"
                   1989: .Pq mdoc , tbl
                   1990: Various
                   1991: .Xr mdoc 7
                   1992: macros as well as tables require explicit closing by dedicated macros.
                   1993: A block that doesn't support bad nesting
                   1994: ends before all of its children are properly closed.
                   1995: The open child nodes are closed implicitly.
1.152     schwarze 1996: .It Sy "appending missing end of block"
1.106     schwarze 1997: .Pq mdoc , man , eqn , tbl , roff
                   1998: At the end of the document, an explicit
                   1999: .Xr mdoc 7
                   2000: block, a
                   2001: .Xr man 7
                   2002: next-line scope or
1.206     schwarze 2003: .Ic \&MT , \&RS
1.106     schwarze 2004: or
                   2005: .Ic \&UR
                   2006: block, an equation, table, or
                   2007: .Xr roff 7
                   2008: conditional or ignore block is still open.
                   2009: The open block is closed implicitly.
                   2010: .It Sy "escaped character not allowed in a name"
                   2011: .Pq roff
                   2012: Macro, string and register identifiers consist of printable,
                   2013: non-whitespace ASCII characters.
                   2014: Escape sequences and characters and strings expressed in terms of them
                   2015: cannot form part of a name.
                   2016: The first argument of an
                   2017: .Ic \&am ,
                   2018: .Ic \&as ,
                   2019: .Ic \&de ,
                   2020: .Ic \&ds ,
                   2021: .Ic \&nr ,
                   2022: or
                   2023: .Ic \&rr
                   2024: request, or any argument of an
                   2025: .Ic \&rm
                   2026: request, or the name of a request or user defined macro being called,
                   2027: is terminated by an escape sequence.
                   2028: In the cases of
                   2029: .Ic \&as ,
                   2030: .Ic \&ds ,
                   2031: and
                   2032: .Ic \&nr ,
                   2033: the request has no effect at all.
                   2034: In the cases of
                   2035: .Ic \&am ,
                   2036: .Ic \&de ,
                   2037: .Ic \&rr ,
                   2038: and
                   2039: .Ic \&rm ,
                   2040: what was parsed up to this point is used as the arguments to the request,
                   2041: and the rest of the input line is discarded including the escape sequence.
                   2042: When parsing for a request or a user-defined macro name to be called,
                   2043: only the escape sequence is discarded.
                   2044: The characters preceding it are used as the request or macro name,
                   2045: the characters following it are used as the arguments to the request or macro.
1.227     schwarze 2046: .It Sy "using macro argument outside macro"
                   2047: .Pq roff
                   2048: The escape sequence \e$ occurs outside any macro definition
                   2049: and expands to the empty string.
                   2050: .It Sy "argument number is not numeric"
                   2051: .Pq roff
                   2052: The argument of the escape sequence \e$ is not a digit;
                   2053: the escape sequence expands to the empty string.
1.124     schwarze 2054: .It Sy "NOT IMPLEMENTED: Bd -file"
                   2055: .Pq mdoc
                   2056: For security reasons, the
                   2057: .Ic \&Bd
                   2058: macro does not support the
                   2059: .Fl file
                   2060: argument.
                   2061: By requesting the inclusion of a sensitive file, a malicious document
                   2062: might otherwise trick a privileged user into inadvertently displaying
                   2063: the file on the screen, revealing the file content to bystanders.
                   2064: The argument is ignored including the file name following it.
1.163     schwarze 2065: .It Sy "skipping display without arguments"
                   2066: .Pq mdoc
                   2067: A
                   2068: .Ic \&Bd
                   2069: block macro does not have any arguments.
                   2070: The block is discarded, and the block content is displayed in
                   2071: whatever mode was active before the block.
1.106     schwarze 2072: .It Sy "missing list type, using -item"
                   2073: .Pq mdoc
                   2074: A
                   2075: .Ic \&Bl
                   2076: macro fails to specify the list type.
1.194     schwarze 2077: .It Sy "argument is not numeric, using 1"
                   2078: .Pq roff
                   2079: The argument of a
                   2080: .Ic \&ce
                   2081: request is not a number.
1.228     schwarze 2082: .It Sy "argument is not a character"
                   2083: .Pq roff
                   2084: The first argument of a
                   2085: .Ic char
                   2086: request is neither a single ASCII character
                   2087: nor a single character escape sequence.
                   2088: The request is ignored including all its arguments.
1.106     schwarze 2089: .It Sy "missing manual name, using \(dq\(dq"
                   2090: .Pq mdoc
                   2091: The first call to
1.168     schwarze 2092: .Ic \&Nm ,
                   2093: or any call in the NAME section, lacks the required argument.
1.106     schwarze 2094: .It Sy "uname(3) system call failed, using UNKNOWN"
                   2095: .Pq mdoc
                   2096: The
                   2097: .Ic \&Os
                   2098: macro is called without arguments, and the
                   2099: .Xr uname 3
                   2100: system call failed.
                   2101: As a workaround,
                   2102: .Nm
                   2103: can be compiled with
                   2104: .Sm off
                   2105: .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq .
                   2106: .Sm on
                   2107: .It Sy "unknown standard specifier"
                   2108: .Pq mdoc
                   2109: An
                   2110: .Ic \&St
                   2111: macro has an unknown argument and is discarded.
                   2112: .It Sy "skipping request without numeric argument"
1.118     schwarze 2113: .Pq roff , eqn
1.106     schwarze 2114: An
                   2115: .Ic \&it
1.118     schwarze 2116: request or an
                   2117: .Xr eqn 7
                   2118: .Ic \&size
                   2119: or
                   2120: .Ic \&gsize
                   2121: statement has a non-numeric or negative argument or no argument at all.
                   2122: The invalid request or statement is ignored.
1.227     schwarze 2123: .It Sy "excessive shift"
                   2124: .Pq roff
                   2125: The argument of a
                   2126: .Ic shift
                   2127: request is larger than the number of arguments of the macro that is
                   2128: currently being executed.
                   2129: All macro arguments are deleted and \en(.$ is set to zero.
1.132     schwarze 2130: .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
                   2131: .Pq roff
                   2132: For security reasons,
                   2133: .Nm
                   2134: allows
                   2135: .Ic \&so
                   2136: file inclusion requests only with relative paths
                   2137: and only without ascending to any parent directory.
                   2138: By requesting the inclusion of a sensitive file, a malicious document
                   2139: might otherwise trick a privileged user into inadvertently displaying
                   2140: the file on the screen, revealing the file content to bystanders.
                   2141: .Nm
                   2142: only shows the path as it appears behind
                   2143: .Ic \&so .
                   2144: .It Sy ".so request failed"
                   2145: .Pq roff
                   2146: Servicing a
                   2147: .Ic \&so
                   2148: request requires reading an external file, but the file could not be
                   2149: opened.
                   2150: .Nm
                   2151: only shows the path as it appears behind
                   2152: .Ic \&so .
1.106     schwarze 2153: .It Sy "skipping all arguments"
                   2154: .Pq mdoc , man , eqn , roff
                   2155: An
                   2156: .Xr mdoc 7
                   2157: .Ic \&Bt ,
                   2158: .Ic \&Ed ,
                   2159: .Ic \&Ef ,
                   2160: .Ic \&Ek ,
                   2161: .Ic \&El ,
1.144     schwarze 2162: .Ic \&Lp ,
                   2163: .Ic \&Pp ,
1.106     schwarze 2164: .Ic \&Re ,
1.143     schwarze 2165: .Ic \&Rs ,
1.106     schwarze 2166: or
                   2167: .Ic \&Ud
                   2168: macro, an
                   2169: .Ic \&It
                   2170: macro in a list that don't support item heads, a
                   2171: .Xr man 7
                   2172: .Ic \&LP ,
                   2173: .Ic \&P ,
                   2174: or
                   2175: .Ic \&PP
                   2176: macro, an
                   2177: .Xr eqn 7
1.120     schwarze 2178: .Ic \&EQ
                   2179: or
1.106     schwarze 2180: .Ic \&EN
                   2181: macro, or a
                   2182: .Xr roff 7
1.148     schwarze 2183: .Ic \&br ,
                   2184: .Ic \&fi ,
                   2185: or
                   2186: .Ic \&nf
1.144     schwarze 2187: request or
1.106     schwarze 2188: .Sq \&..
                   2189: block closing request is invoked with at least one argument.
                   2190: All arguments are ignored.
                   2191: .It Sy "skipping excess arguments"
1.135     schwarze 2192: .Pq mdoc , man , roff
1.150     schwarze 2193: A macro or request is invoked with too many arguments:
                   2194: .Bl -dash -offset 2n -width 2n -compact
                   2195: .It
                   2196: .Ic \&Fo ,
1.206     schwarze 2197: .Ic \&MT ,
1.150     schwarze 2198: .Ic \&PD ,
                   2199: .Ic \&RS ,
                   2200: .Ic \&UR ,
                   2201: .Ic \&ft ,
                   2202: or
                   2203: .Ic \&sp
                   2204: with more than one argument
                   2205: .It
1.144     schwarze 2206: .Ic \&An
1.150     schwarze 2207: with another argument after
1.144     schwarze 2208: .Fl split
                   2209: or
1.150     schwarze 2210: .Fl nosplit
                   2211: .It
                   2212: .Ic \&RE
                   2213: with more than one argument or with a non-integer argument
                   2214: .It
                   2215: .Ic \&OP
                   2216: or a request of the
                   2217: .Ic \&de
                   2218: family with more than two arguments
1.154     schwarze 2219: .It
                   2220: .Ic \&Dt
                   2221: with more than three arguments
1.150     schwarze 2222: .It
                   2223: .Ic \&TH
                   2224: with more than five arguments
                   2225: .It
1.145     schwarze 2226: .Ic \&Bd ,
                   2227: .Ic \&Bk ,
                   2228: or
                   2229: .Ic \&Bl
1.150     schwarze 2230: with invalid arguments
                   2231: .El
1.106     schwarze 2232: The excess arguments are ignored.
1.133     schwarze 2233: .El
                   2234: .Ss Unsupported features
                   2235: .Bl -ohang
                   2236: .It Sy "input too large"
                   2237: .Pq mdoc , man
                   2238: Currently,
                   2239: .Nm
                   2240: cannot handle input files larger than its arbitrary size limit
                   2241: of 2^31 bytes (2 Gigabytes).
                   2242: Since useful manuals are always small, this is not a problem in practice.
                   2243: Parsing is aborted as soon as the condition is detected.
1.136     schwarze 2244: .It Sy "unsupported control character"
                   2245: .Pq roff
                   2246: An ASCII control character supported by other
                   2247: .Xr roff 7
                   2248: implementations but not by
                   2249: .Nm
                   2250: was found in an input file.
                   2251: It is replaced by a question mark.
1.232     schwarze 2252: .It Sy "unsupported escape sequence"
                   2253: .Pq roff
                   2254: An input file contains an escape sequence supported by GNU troff
                   2255: or Heirloom troff but not by
                   2256: .Nm ,
                   2257: and it is likely that this will cause information loss
                   2258: or considerable misformatting.
1.133     schwarze 2259: .It Sy "unsupported roff request"
                   2260: .Pq roff
                   2261: An input file contains a
                   2262: .Xr roff 7
                   2263: request supported by GNU troff or Heirloom troff but not by
                   2264: .Nm ,
                   2265: and it is likely that this will cause information loss
                   2266: or considerable misformatting.
1.139     schwarze 2267: .It Sy "eqn delim option in tbl"
                   2268: .Pq eqn , tbl
                   2269: The options line of a table defines equation delimiters.
                   2270: Any equation source code contained in the table will be printed unformatted.
                   2271: .It Sy "unsupported table layout modifier"
1.138     schwarze 2272: .Pq tbl
                   2273: A table layout specification contains an
                   2274: .Sq Cm m
                   2275: modifier.
                   2276: The modifier is discarded.
1.133     schwarze 2277: .It Sy "ignoring macro in table"
1.139     schwarze 2278: .Pq tbl , mdoc , man
                   2279: A table contains an invocation of an
                   2280: .Xr mdoc 7
                   2281: or
                   2282: .Xr man 7
                   2283: macro or of an undefined macro.
                   2284: The macro is ignored, and its arguments are handled
                   2285: as if they were a text line.
1.240     schwarze 2286: .El
                   2287: .Ss Bad command line arguments
                   2288: .Bl -ohang
                   2289: .It Sy "bad command line argument"
                   2290: The argument following one of the
                   2291: .Fl IKMmOTW
                   2292: command line options is invalid, or a
                   2293: .Ar file
                   2294: given as a command line argument cannot be opened.
                   2295: .It Sy "duplicate command line argument"
                   2296: The
                   2297: .Fl I
                   2298: command line option was specified twice.
                   2299: .It Sy "option has a superfluous value"
                   2300: An argument to the
                   2301: .Fl O
                   2302: option has a value but does not accept one.
                   2303: .It Sy "missing option value"
                   2304: An argument to the
                   2305: .Fl O
                   2306: option has no argument but requires one.
                   2307: .It Sy "bad option value"
                   2308: An argument to the
                   2309: .Fl O
                   2310: .Cm indent
                   2311: or
                   2312: .Cm width
                   2313: option has an invalid value.
                   2314: .It Sy "duplicate option value"
                   2315: The same
                   2316: .Fl O
                   2317: option is specified more than once.
                   2318: .It Sy "no such tag"
                   2319: The
                   2320: .Fl O Cm tag
                   2321: option was specified but the tag was not found in any of the displayed
                   2322: manual pages.
1.106     schwarze 2323: .El
1.1       kristaps 2324: .Sh SEE ALSO
1.141     schwarze 2325: .Xr apropos 1 ,
                   2326: .Xr man 1 ,
1.85      kristaps 2327: .Xr eqn 7 ,
1.57      kristaps 2328: .Xr man 7 ,
1.13      kristaps 2329: .Xr mandoc_char 7 ,
1.84      kristaps 2330: .Xr mdoc 7 ,
                   2331: .Xr roff 7 ,
                   2332: .Xr tbl 7
1.173     schwarze 2333: .Sh HISTORY
                   2334: The
                   2335: .Nm
                   2336: utility first appeared in
                   2337: .Ox 4.8 .
                   2338: The option
                   2339: .Fl I
                   2340: appeared in
                   2341: .Ox 5.2 ,
                   2342: and
                   2343: .Fl aCcfhKklMSsw
                   2344: in
                   2345: .Ox 5.7 .
1.1       kristaps 2346: .Sh AUTHORS
1.156     schwarze 2347: .An -nosplit
1.1       kristaps 2348: The
                   2349: .Nm
1.26      kristaps 2350: utility was written by
1.141     schwarze 2351: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
                   2352: and is maintained by
                   2353: .An Ingo Schwarze Aq Mt schwarze@openbsd.org .

CVSweb