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