[BACK]Return to mandoc.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Annotation of src/usr.bin/mandoc/mandoc.1, Revision 1.73

1.73    ! schwarze    1: .\"    $OpenBSD: mandoc.1,v 1.72 2015/01/15 04:26:06 schwarze Exp $
1.1       kristaps    2: .\"
1.44      schwarze    3: .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
1.71      schwarze    4: .\" Copyright (c) 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
1.1       kristaps    5: .\"
                      6: .\" Permission to use, copy, modify, and distribute this software for any
1.3       schwarze    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.3       schwarze   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.73    ! schwarze   18: .Dd $Mdocdate: January 15 2015 $
1.2       deraadt    19: .Dt MANDOC 1
1.1       kristaps   20: .Os
                     21: .Sh NAME
                     22: .Nm mandoc
                     23: .Nd format and display UNIX manuals
                     24: .Sh SYNOPSIS
                     25: .Nm mandoc
1.62      schwarze   26: .Op Fl acfhklV
1.54      schwarze   27: .Sm off
                     28: .Op Fl I Cm os Li = Ar name
                     29: .Sm on
1.65      jmc        30: .Op Fl K Ns Ar encoding
1.1       kristaps   31: .Op Fl m Ns Ar format
1.26      jmc        32: .Op Fl O Ns Ar option
1.17      schwarze   33: .Op Fl T Ns Ar output
1.38      schwarze   34: .Op Fl W Ns Ar level
1.45      schwarze   35: .Op Ar
1.1       kristaps   36: .Sh DESCRIPTION
                     37: The
                     38: .Nm
1.10      schwarze   39: utility formats
1.1       kristaps   40: .Ux
1.25      jmc        41: manual pages for display.
1.53      schwarze   42: .Pp
                     43: By default,
                     44: .Nm
                     45: reads
                     46: .Xr mdoc 7
                     47: or
                     48: .Xr man 7
                     49: text from stdin, implying
                     50: .Fl m Ns Cm andoc ,
                     51: and produces
1.68      schwarze   52: .Fl T Ns Cm locale
1.53      schwarze   53: output.
                     54: .Pp
1.61      schwarze   55: The options are as follows:
1.5       schwarze   56: .Bl -tag -width Ds
1.60      schwarze   57: .It Fl a
                     58: If the standard output is a terminal device and
                     59: .Fl c
                     60: is not specified, use
                     61: .Xr more 1
                     62: to paginate the output, just like
                     63: .Xr man 1
                     64: would.
                     65: .It Fl c
                     66: Copy the formatted manual pages to the standard output without using
                     67: .Xr more 1
                     68: to paginate them.
                     69: This is the default.
                     70: It can be specified to override
                     71: .Fl a .
1.61      schwarze   72: .It Fl f
                     73: A synonym for
                     74: .Xr whatis 1 .
                     75: This overrides any earlier
                     76: .Fl k
                     77: and
                     78: .Fl l
                     79: options.
1.54      schwarze   80: .Sm off
                     81: .It Fl I Cm os Li = Ar name
                     82: .Sm on
                     83: Override the default operating system
                     84: .Ar name
                     85: for the
                     86: .Xr mdoc 7
                     87: .Sq \&Os
1.70      schwarze   88: and for the
                     89: .Xr man 7
                     90: .Sq \&TH
1.54      schwarze   91: macro.
1.62      schwarze   92: .It Fl h
                     93: Display only the SYNOPSIS lines.
                     94: Implies
1.66      schwarze   95: .Fl c .
1.64      schwarze   96: .It Fl K Ns Ar encoding
                     97: Specify the input encoding.
                     98: The supported
                     99: .Ar encoding
                    100: arguments are
                    101: .Cm us-ascii ,
                    102: .Cm iso-8859-1 ,
                    103: and
                    104: .Cm utf-8 .
                    105: If not specified, autodetection uses the first match:
                    106: .Bl -tag -width iso-8859-1
                    107: .It Cm utf-8
                    108: if the first three bytes of the input file
                    109: are the UTF-8 byte order mark (BOM, 0xefbbbf)
                    110: .It Ar encoding
                    111: if the first or second line of the input file matches the
                    112: .Sy emacs
                    113: mode line format
                    114: .Pp
                    115: .D1 .\e" -*- Oo ...; Oc coding: Ar encoding ; No -*-
                    116: .It Cm utf-8
                    117: if the first non-ASCII byte in the file introduces a valid UTF-8 sequence
                    118: .It Cm iso-8859-1
                    119: otherwise
                    120: .El
1.61      schwarze  121: .It Fl k
                    122: A synonym for
                    123: .Xr apropos 1 .
                    124: This overrides any earlier
                    125: .Fl f
                    126: and
                    127: .Fl l
                    128: options.
                    129: .It Fl l
                    130: A synonym for
                    131: .Fl a .
                    132: Also reverts any earlier
                    133: .Fl f
                    134: and
                    135: .Fl k
                    136: options.
1.1       kristaps  137: .It Fl m Ns Ar format
1.25      jmc       138: Input format.
                    139: See
1.1       kristaps  140: .Sx Input Formats
1.25      jmc       141: for available formats.
                    142: Defaults to
1.26      jmc       143: .Fl m Ns Cm andoc .
                    144: .It Fl O Ns Ar option
1.25      jmc       145: Comma-separated output options.
1.1       kristaps  146: .It Fl T Ns Ar output
1.25      jmc       147: Output format.
                    148: See
1.1       kristaps  149: .Sx Output Formats
1.25      jmc       150: for available formats.
                    151: Defaults to
1.68      schwarze  152: .Fl T Ns Cm locale .
1.4       schwarze  153: .It Fl V
                    154: Print version and exit.
1.38      schwarze  155: .It Fl W Ns Ar level
                    156: Specify the minimum message
                    157: .Ar level
                    158: to be reported on the standard error output and to affect the exit status.
                    159: The
                    160: .Ar level
                    161: can be
1.73    ! schwarze  162: .Cm warning ,
        !           163: .Cm error ,
1.38      schwarze  164: or
1.73    ! schwarze  165: .Cm unsupp ;
1.72      schwarze  166: .Cm all
1.38      schwarze  167: is an alias for
1.72      schwarze  168: .Cm warning .
                    169: By default,
                    170: .Nm
                    171: is silent.
1.38      schwarze  172: See
                    173: .Sx EXIT STATUS
                    174: and
                    175: .Sx DIAGNOSTICS
                    176: for details.
                    177: .Pp
                    178: The special option
                    179: .Fl W Ns Cm stop
                    180: tells
                    181: .Nm
                    182: to exit after parsing a file that causes warnings or errors of at least
                    183: the requested level.
                    184: No formatted output will be produced from that file.
                    185: If both a
                    186: .Ar level
                    187: and
                    188: .Cm stop
                    189: are requested, they can be joined with a comma, for example
                    190: .Fl W Ns Cm error , Ns Cm stop .
1.26      jmc       191: .It Ar file
                    192: Read input from zero or more files.
1.25      jmc       193: If unspecified, reads from stdin.
                    194: If multiple files are specified,
1.1       kristaps  195: .Nm
                    196: will halt with the first failed parse.
                    197: .El
1.61      schwarze  198: .Pp
                    199: In
                    200: .Fl f
                    201: and
                    202: .Fl k
                    203: mode,
                    204: .Nm
                    205: also supports the options
                    206: .Fl CMmOSsw
                    207: described in the
                    208: .Xr apropos 1
                    209: manual.
1.1       kristaps  210: .Ss Input Formats
                    211: The
                    212: .Nm
                    213: utility accepts
                    214: .Xr mdoc 7
                    215: and
                    216: .Xr man 7
                    217: input with
1.26      jmc       218: .Fl m Ns Cm doc
1.1       kristaps  219: and
1.26      jmc       220: .Fl m Ns Cm an ,
1.25      jmc       221: respectively.
                    222: The
1.1       kristaps  223: .Xr mdoc 7
                    224: format is
                    225: .Em strongly
1.10      schwarze  226: recommended;
1.1       kristaps  227: .Xr man 7
                    228: should only be used for legacy manuals.
                    229: .Pp
                    230: A third option,
1.26      jmc       231: .Fl m Ns Cm andoc ,
1.1       kristaps  232: which is also the default, determines encoding on-the-fly: if the first
1.10      schwarze  233: non-comment macro is
1.11      schwarze  234: .Sq \&Dd
1.1       kristaps  235: or
1.11      schwarze  236: .Sq \&Dt ,
1.10      schwarze  237: the
1.1       kristaps  238: .Xr mdoc 7
                    239: parser is used; otherwise, the
                    240: .Xr man 7
                    241: parser is used.
                    242: .Pp
                    243: If multiple
1.10      schwarze  244: files are specified with
1.26      jmc       245: .Fl m Ns Cm andoc ,
1.25      jmc       246: each has its file-type determined this way.
                    247: If multiple files are
1.1       kristaps  248: specified and
1.26      jmc       249: .Fl m Ns Cm doc
1.1       kristaps  250: or
1.26      jmc       251: .Fl m Ns Cm an
1.1       kristaps  252: is specified, then this format is used exclusively.
                    253: .Ss Output Formats
                    254: The
                    255: .Nm
                    256: utility accepts the following
                    257: .Fl T
1.34      schwarze  258: arguments, which correspond to output modes:
1.48      jmc       259: .Bl -tag -width "-Tlocale"
1.26      jmc       260: .It Fl T Ns Cm ascii
1.42      schwarze  261: Produce 7-bit ASCII output.
1.25      jmc       262: See
1.20      schwarze  263: .Sx ASCII Output .
1.26      jmc       264: .It Fl T Ns Cm html
1.69      schwarze  265: Produce HTML5, CSS1, and MathML output.
1.25      jmc       266: See
1.20      schwarze  267: .Sx HTML Output .
1.26      jmc       268: .It Fl T Ns Cm lint
                    269: Parse only: produce no output.
                    270: Implies
1.38      schwarze  271: .Fl W Ns Cm warning .
1.48      jmc       272: .It Fl T Ns Cm locale
                    273: Encode output using the current locale.
1.68      schwarze  274: This is the default.
1.48      jmc       275: See
                    276: .Sx Locale Output .
1.46      schwarze  277: .It Fl T Ns Cm man
1.49      schwarze  278: Produce
1.46      schwarze  279: .Xr man 7
1.49      schwarze  280: format output.
                    281: See
                    282: .Sx Man Output .
1.36      schwarze  283: .It Fl T Ns Cm pdf
                    284: Produce PDF output.
                    285: See
                    286: .Sx PDF Output .
1.31      schwarze  287: .It Fl T Ns Cm ps
                    288: Produce PostScript output.
                    289: See
                    290: .Sx PostScript Output .
1.26      jmc       291: .It Fl T Ns Cm tree
                    292: Produce an indented parse tree.
1.48      jmc       293: .It Fl T Ns Cm utf8
                    294: Encode output in the UTF\-8 multi-byte format.
                    295: See
                    296: .Sx UTF\-8 Output .
1.26      jmc       297: .It Fl T Ns Cm xhtml
1.63      schwarze  298: This is a synonym for
                    299: .Fl T Ns Cm html .
1.1       kristaps  300: .El
                    301: .Pp
                    302: If multiple input files are specified, these will be processed by the
                    303: corresponding filter in-order.
1.34      schwarze  304: .Ss ASCII Output
                    305: Output produced by
1.68      schwarze  306: .Fl T Ns Cm ascii
                    307: is rendered in standard 7-bit ASCII documented in
1.34      schwarze  308: .Xr ascii 7 .
                    309: .Pp
                    310: Font styles are applied by using back-spaced encoding such that an
                    311: underlined character
                    312: .Sq c
                    313: is rendered as
                    314: .Sq _ Ns \e[bs] Ns c ,
                    315: where
                    316: .Sq \e[bs]
                    317: is the back-space character number 8.
                    318: Emboldened characters are rendered as
                    319: .Sq c Ns \e[bs] Ns c .
                    320: .Pp
                    321: The special characters documented in
                    322: .Xr mandoc_char 7
                    323: are rendered best-effort in an ASCII equivalent.
1.44      schwarze  324: If no equivalent is found,
                    325: .Sq \&?
                    326: is used instead.
1.34      schwarze  327: .Pp
                    328: Output width is limited to 78 visible columns unless literal input lines
                    329: exceed this limit.
                    330: .Pp
                    331: The following
                    332: .Fl O
                    333: arguments are accepted:
1.5       schwarze  334: .Bl -tag -width Ds
1.51      schwarze  335: .It Cm indent Ns = Ns Ar indent
                    336: The left margin for normal text is set to
                    337: .Ar indent
                    338: blank characters instead of the default of five for
                    339: .Xr mdoc 7
                    340: and seven for
                    341: .Xr man 7 .
                    342: Increasing this is not recommended; it may result in degraded formatting,
1.52      jmc       343: for example overfull lines or ugly line breaks.
1.34      schwarze  344: .It Cm width Ns = Ns Ar width
                    345: The output width is set to
                    346: .Ar width ,
                    347: which will normalise to \(>=60.
1.1       kristaps  348: .El
1.34      schwarze  349: .Ss HTML Output
                    350: Output produced by
                    351: .Fl T Ns Cm html
1.63      schwarze  352: conforms to HTML5 using optional self-closing tags.
1.69      schwarze  353: Default styles use only CSS1.
                    354: Equations rendered from
                    355: .Xr eqn 7
                    356: blocks use MathML.
1.34      schwarze  357: .Pp
1.30      schwarze  358: The
1.34      schwarze  359: .Pa example.style.css
1.42      schwarze  360: file documents style-sheet classes available for customising output.
                    361: If a style-sheet is not specified with
                    362: .Fl O Ns Ar style ,
                    363: .Fl T Ns Cm html
1.63      schwarze  364: defaults to simple output (via an embedded style-sheet)
                    365: readable in any graphical or text-based web
1.42      schwarze  366: browser.
1.34      schwarze  367: .Pp
1.45      schwarze  368: Special characters are rendered in decimal-encoded UTF\-8.
1.34      schwarze  369: .Pp
                    370: The following
1.33      schwarze  371: .Fl O
1.34      schwarze  372: arguments are accepted:
1.17      schwarze  373: .Bl -tag -width Ds
1.49      schwarze  374: .It Cm fragment
1.67      bentley   375: Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
                    376: elements and only emit the subtree below the <body> element.
1.49      schwarze  377: The
                    378: .Cm style
1.50      schwarze  379: argument will be ignored.
1.49      schwarze  380: This is useful when embedding manual content within existing documents.
1.33      schwarze  381: .It Cm includes Ns = Ns Ar fmt
1.17      schwarze  382: The string
                    383: .Ar fmt ,
1.21      schwarze  384: for example,
1.17      schwarze  385: .Ar ../src/%I.html ,
                    386: is used as a template for linked header files (usually via the
                    387: .Sq \&In
1.25      jmc       388: macro).
                    389: Instances of
1.17      schwarze  390: .Sq \&%I
1.25      jmc       391: are replaced with the include filename.
                    392: The default is not to present a
1.17      schwarze  393: hyperlink.
1.33      schwarze  394: .It Cm man Ns = Ns Ar fmt
1.17      schwarze  395: The string
                    396: .Ar fmt ,
1.21      schwarze  397: for example,
1.17      schwarze  398: .Ar ../html%S/%N.%S.html ,
                    399: is used as a template for linked manuals (usually via the
                    400: .Sq \&Xr
1.25      jmc       401: macro).
                    402: Instances of
1.17      schwarze  403: .Sq \&%N
                    404: and
                    405: .Sq %S
                    406: are replaced with the linked manual's name and section, respectively.
1.25      jmc       407: If no section is included, section 1 is assumed.
                    408: The default is not to
1.17      schwarze  409: present a hyperlink.
1.33      schwarze  410: .It Cm style Ns = Ns Ar style.css
1.26      jmc       411: The file
                    412: .Ar style.css
                    413: is used for an external style-sheet.
                    414: This must be a valid absolute or
                    415: relative URI.
1.30      schwarze  416: .El
1.48      jmc       417: .Ss Locale Output
                    418: Locale-depending output encoding is triggered with
                    419: .Fl T Ns Cm locale .
1.68      schwarze  420: This is the default.
                    421: .Pp
1.48      jmc       422: This option is not available on all systems: systems without locale
                    423: support, or those whose internal representation is not natively UCS-4,
                    424: will fall back to
                    425: .Fl T Ns Cm ascii .
                    426: See
                    427: .Sx ASCII Output
                    428: for font style specification and available command-line arguments.
1.49      schwarze  429: .Ss Man Output
                    430: Translate input format into
                    431: .Xr man 7
                    432: output format.
1.55      jmc       433: This is useful for distributing manual sources to legacy systems
1.49      schwarze  434: lacking
                    435: .Xr mdoc 7
                    436: formatters.
                    437: .Pp
                    438: If
                    439: .Xr mdoc 7
                    440: is passed as input, it is translated into
1.50      schwarze  441: .Xr man 7 .
                    442: If the input format is
1.49      schwarze  443: .Xr man 7 ,
1.50      schwarze  444: the input is copied to the output, expanding any
1.49      schwarze  445: .Xr roff 7
                    446: .Sq so
1.50      schwarze  447: requests.
                    448: The parser is also run, and as usual, the
                    449: .Fl W
                    450: level controls which
                    451: .Sx DIAGNOSTICS
                    452: are displayed before copying the input to the output.
1.48      jmc       453: .Ss PDF Output
                    454: PDF-1.1 output may be generated by
                    455: .Fl T Ns Cm pdf .
                    456: See
                    457: .Sx PostScript Output
                    458: for
                    459: .Fl O
                    460: arguments and defaults.
1.31      schwarze  461: .Ss PostScript Output
1.33      schwarze  462: PostScript
                    463: .Qq Adobe-3.0
                    464: Level-2 pages may be generated by
1.31      schwarze  465: .Fl T Ns Cm ps .
1.35      schwarze  466: Output pages default to letter sized and are rendered in the Times font
                    467: family, 11-point.
                    468: Margins are calculated as 1/9 the page length and width.
                    469: Line-height is 1.4m.
1.34      schwarze  470: .Pp
                    471: Special characters are rendered as in
                    472: .Sx ASCII Output .
                    473: .Pp
                    474: The following
                    475: .Fl O
                    476: arguments are accepted:
                    477: .Bl -tag -width Ds
                    478: .It Cm paper Ns = Ns Ar name
                    479: The paper size
                    480: .Ar name
                    481: may be one of
1.35      schwarze  482: .Ar a3 ,
                    483: .Ar a4 ,
                    484: .Ar a5 ,
                    485: .Ar legal ,
1.34      schwarze  486: or
                    487: .Ar letter .
1.35      schwarze  488: You may also manually specify dimensions as
                    489: .Ar NNxNN ,
                    490: width by height in millimetres.
                    491: If an unknown value is encountered,
                    492: .Ar letter
                    493: is used.
1.34      schwarze  494: .El
1.48      jmc       495: .Ss UTF\-8 Output
                    496: Use
                    497: .Fl T Ns Cm utf8
                    498: to force a UTF\-8 locale.
1.36      schwarze  499: See
1.48      jmc       500: .Sx Locale Output
                    501: for details and options.
1.60      schwarze  502: .Sh ENVIRONMENT
                    503: .Bl -tag -width MANPAGER
                    504: .It Ev MANPAGER
                    505: Any non-empty value of the environment variable
                    506: .Ev MANPAGER
                    507: will be used instead of the standard pagination program,
                    508: .Xr more 1 .
                    509: .It Ev PAGER
                    510: Specifies the pagination program to use when
                    511: .Ev MANPAGER
                    512: is not defined.
                    513: If neither PAGER nor MANPAGER is defined,
                    514: .Pa /usr/bin/more Fl s
                    515: will be used.
                    516: .El
1.38      schwarze  517: .Sh EXIT STATUS
                    518: The
                    519: .Nm
                    520: utility exits with one of the following values, controlled by the message
                    521: .Ar level
                    522: associated with the
                    523: .Fl W
                    524: option:
                    525: .Pp
                    526: .Bl -tag -width Ds -compact
                    527: .It 0
                    528: No warnings or errors occurred, or those that did were ignored because
                    529: they were lower than the requested
                    530: .Ar level .
                    531: .It 2
                    532: At least one warning occurred, but no error, and
                    533: .Fl W Ns Cm warning
                    534: was specified.
                    535: .It 3
1.73    ! schwarze  536: At least one parsing error occurred,
        !           537: but no unsupported feature was encountered, and
        !           538: .Fl W Ns Cm error
        !           539: or
        !           540: .Fl W Ns Cm warning
        !           541: was specified.
        !           542: .It 4
        !           543: At least on unsupported feature was encountered, and
        !           544: .Fl W Ns Cm unsupp ,
1.38      schwarze  545: .Fl W Ns Cm error
                    546: or
                    547: .Fl W Ns Cm warning
                    548: was specified.
                    549: .It 5
                    550: Invalid command line arguments were specified.
                    551: No input files have been read.
                    552: .It 6
1.71      schwarze  553: An operating system error occurred, for example exhaustion
                    554: of memory, file descriptors, or process table entries.
1.38      schwarze  555: Such errors cause
                    556: .Nm
                    557: to exit at once, possibly in the middle of parsing or formatting a file.
                    558: .El
                    559: .Pp
                    560: Note that selecting
                    561: .Fl T Ns Cm lint
                    562: output mode implies
                    563: .Fl W Ns Cm warning .
1.1       kristaps  564: .Sh EXAMPLES
                    565: To page manuals to the terminal:
                    566: .Pp
1.42      schwarze  567: .Dl $ mandoc \-Wall,stop mandoc.1 2\*(Gt&1 | less
                    568: .Dl $ mandoc mandoc.1 mdoc.3 mdoc.7 | less
1.12      schwarze  569: .Pp
1.17      schwarze  570: To produce HTML manuals with
                    571: .Ar style.css
                    572: as the style-sheet:
                    573: .Pp
1.42      schwarze  574: .Dl $ mandoc \-Thtml -Ostyle=style.css mdoc.7 \*(Gt mdoc.7.html
1.17      schwarze  575: .Pp
1.12      schwarze  576: To check over a large set of manuals:
                    577: .Pp
1.38      schwarze  578: .Dl $ mandoc \-Tlint `find /usr/src -name \e*\e.[1-9]`
1.34      schwarze  579: .Pp
                    580: To produce a series of PostScript manuals for A4 paper:
                    581: .Pp
1.42      schwarze  582: .Dl $ mandoc \-Tps \-Opaper=a4 mdoc.7 man.7 \*(Gt manuals.ps
1.46      schwarze  583: .Pp
                    584: Convert a modern
                    585: .Xr mdoc 7
                    586: manual to the older
                    587: .Xr man 7
                    588: format, for use on systems lacking an
                    589: .Xr mdoc 7
                    590: parser:
                    591: .Pp
                    592: .Dl $ mandoc \-Tman foo.mdoc \*(Gt foo.man
1.38      schwarze  593: .Sh DIAGNOSTICS
1.59      schwarze  594: Messages displayed by
                    595: .Nm
                    596: follow this format:
1.38      schwarze  597: .Pp
1.59      schwarze  598: .D1 Nm Ns : Ar file : Ns Ar line : Ns Ar column : level : message : macro args
1.38      schwarze  599: .Pp
1.59      schwarze  600: Line and column numbers start at 1.
                    601: Both are omitted for messages referring to an input file as a whole.
                    602: Macro names and arguments are omitted where meaningless.
                    603: Fatal messages about invalid command line arguments
                    604: or operating system errors, for example when memory is exhausted,
                    605: may also omit the
                    606: .Ar file
1.57      schwarze  607: and
1.59      schwarze  608: .Ar level
                    609: fields.
1.57      schwarze  610: .Pp
1.38      schwarze  611: Message levels have the following meanings:
                    612: .Bl -tag -width "warning"
1.73    ! schwarze  613: .It Cm unsupp
        !           614: An input file uses unsupported low-level
        !           615: .Xr roff 7
        !           616: features.
        !           617: The output may be incomplete and/or misformatted,
        !           618: so using GNU troff instead of
        !           619: .Nm
        !           620: to process the file may be preferable.
1.38      schwarze  621: .It Cm error
1.73    ! schwarze  622: An input file contains invalid syntax that cannot be safely interpreted.
1.38      schwarze  623: By discarding part of the input or inserting missing tokens,
                    624: the parser is able to continue, and the error does not prevent
                    625: generation of formatted output, but typically, preparing that
                    626: output involves information loss, broken document structure
1.73    ! schwarze  627: or unintended formatting, no matter whether
        !           628: .Nm
        !           629: or GNU troff is used.
        !           630: In many cases, the output of
        !           631: .Nm
        !           632: and GNU troff is identical, but in some,
        !           633: .Nm
        !           634: is more resilient than GNU troff with respect to malformed input.
1.71      schwarze  635: .Pp
                    636: Non-existent or unreadable input files are also reported on the
                    637: .Cm error
                    638: level.
                    639: In that case, the parser cannot even be started and no output
                    640: is produced from those input files.
1.38      schwarze  641: .It Cm warning
                    642: An input file uses obsolete, discouraged or non-portable syntax.
                    643: All the same, the meaning of the input is unambiguous and a correct
                    644: rendering can be produced.
                    645: Documents causing warnings may render poorly when using other
                    646: formatting tools instead of
                    647: .Nm .
                    648: .El
                    649: .Pp
                    650: Messages of the
1.73    ! schwarze  651: .Cm warning ,
        !           652: .Cm error ,
1.38      schwarze  653: and
1.73    ! schwarze  654: .Cm unsupp
1.71      schwarze  655: levels except those about non-existent or unreadable input files
                    656: are hidden unless their level, or a lower level, is requested using a
1.38      schwarze  657: .Fl W
                    658: option or
                    659: .Fl T Ns Cm lint
                    660: output mode.
1.6       schwarze  661: .Sh COMPATIBILITY
1.10      schwarze  662: This section summarises
1.6       schwarze  663: .Nm
1.39      schwarze  664: compatibility with GNU troff.
1.14      schwarze  665: Each input and output format is separately noted.
1.20      schwarze  666: .Ss ASCII Compatibility
1.6       schwarze  667: .Bl -bullet -compact
1.13      schwarze  668: .It
1.44      schwarze  669: Unrenderable unicode codepoints specified with
                    670: .Sq \e[uNNNN]
                    671: escapes are printed as
                    672: .Sq \&?
                    673: in mandoc.
                    674: In GNU troff, these raise an error.
                    675: .It
1.21      schwarze  676: The
1.14      schwarze  677: .Sq \&Bd \-literal
1.21      schwarze  678: and
1.14      schwarze  679: .Sq \&Bd \-unfilled
                    680: macros of
                    681: .Xr mdoc 7
                    682: in
1.26      jmc       683: .Fl T Ns Cm ascii
1.14      schwarze  684: are synonyms, as are \-filled and \-ragged.
                    685: .It
1.44      schwarze  686: In historic GNU troff, the
1.14      schwarze  687: .Sq \&Pa
                    688: .Xr mdoc 7
                    689: macro does not underline when scoped under an
                    690: .Sq \&It
1.25      jmc       691: in the FILES section.
                    692: This behaves correctly in
1.14      schwarze  693: .Nm .
1.10      schwarze  694: .It
1.26      jmc       695: A list or display following the
1.11      schwarze  696: .Sq \&Ss
1.14      schwarze  697: .Xr mdoc 7
                    698: macro in
1.26      jmc       699: .Fl T Ns Cm ascii
1.6       schwarze  700: does not assert a prior vertical break, just as it doesn't with
1.11      schwarze  701: .Sq \&Sh .
1.6       schwarze  702: .It
1.14      schwarze  703: The
                    704: .Sq \&na
                    705: .Xr man 7
1.16      schwarze  706: macro in
1.26      jmc       707: .Fl T Ns Cm ascii
1.16      schwarze  708: has no effect.
1.6       schwarze  709: .It
                    710: Words aren't hyphenated.
                    711: .El
1.63      schwarze  712: .Ss HTML Compatibility
1.17      schwarze  713: .Bl -bullet -compact
                    714: .It
                    715: The
1.20      schwarze  716: .Sq \efP
                    717: escape will revert the font to the previous
                    718: .Sq \ef
                    719: escape, not to the last rendered decoration, which is now dictated by
1.25      jmc       720: CSS instead of hard-coded.
                    721: It also will not span past the current scope,
                    722: for the same reason.
                    723: Note that in
1.20      schwarze  724: .Sx ASCII Output
                    725: mode, this will work fine.
                    726: .It
                    727: The
1.17      schwarze  728: .Xr mdoc 7
                    729: .Sq \&Bl \-hang
                    730: and
                    731: .Sq \&Bl \-tag
                    732: list types render similarly (no break following overreached left-hand
                    733: side) due to the expressive constraints of HTML.
                    734: .It
                    735: The
                    736: .Xr man 7
                    737: .Sq IP
                    738: and
                    739: .Sq TP
                    740: lists render similarly.
                    741: .El
1.1       kristaps  742: .Sh SEE ALSO
1.47      schwarze  743: .Xr eqn 7 ,
1.25      jmc       744: .Xr man 7 ,
1.1       kristaps  745: .Xr mandoc_char 7 ,
1.43      schwarze  746: .Xr mdoc 7 ,
                    747: .Xr roff 7 ,
                    748: .Xr tbl 7
1.1       kristaps  749: .Sh AUTHORS
                    750: The
                    751: .Nm
1.10      schwarze  752: utility was written by
1.56      schwarze  753: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.17      schwarze  754: .Sh CAVEATS
                    755: In
1.26      jmc       756: .Fl T Ns Cm html
1.21      schwarze  757: and
1.26      jmc       758: .Fl T Ns Cm xhtml ,
1.17      schwarze  759: the maximum size of an element attribute is determined by
                    760: .Dv BUFSIZ ,
1.25      jmc       761: which is usually 1024 bytes.
                    762: Be aware of this when setting long link
1.26      jmc       763: formats such as
                    764: .Fl O Ns Cm style Ns = Ns Ar really/long/link .
1.22      schwarze  765: .Pp
                    766: Nesting elements within next-line element scopes of
1.26      jmc       767: .Fl m Ns Cm an ,
1.22      schwarze  768: such as
                    769: .Sq br
                    770: within an empty
                    771: .Sq B ,
                    772: will confuse
1.26      jmc       773: .Fl T Ns Cm html
1.22      schwarze  774: and
1.26      jmc       775: .Fl T Ns Cm xhtml
1.23      schwarze  776: and cause them to forget the formatting of the prior next-line scope.
                    777: .Pp
1.24      schwarze  778: The
                    779: .Sq \(aq
                    780: control character is an alias for the standard macro control character
                    781: and does not emit a line-break as stipulated in GNU troff.