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

Annotation of mandoc/mandoc.1, Revision 1.236

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

CVSweb