[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.66

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