Annotation of mandoc/mandoc.1, Revision 1.266
1.266 ! schwarze 1: .\" $Id: mandoc.1,v 1.265 2023/10/18 14:34:29 schwarze Exp $
1.1 kristaps 2: .\"
1.266 ! schwarze 3: .\" Copyright (c) 2012, 2014-2023 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.266 ! schwarze 18: .Dd $Mdocdate: October 18 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"
1.266 ! schwarze 1298: .Pq mdoc , man
1.211 schwarze 1299: An
1300: .Ic \&Xr
1.266 ! schwarze 1301: or
! 1302: .Ic \&MR
1.211 schwarze 1303: macro refers to a name and section matching the section of the present
1304: manual page and a name mentioned in an
1305: .Ic \&Nm
1306: macro in the NAME or SYNOPSIS section, or in an
1307: .Ic \&Fn
1308: or
1309: .Ic \&Fo
1310: macro in the SYNOPSIS.
1311: Consider using
1312: .Ic \&Nm
1313: or
1314: .Ic \&Fn
1315: instead of
1316: .Ic \&Xr .
1.112 schwarze 1317: .It Sy "unusual Xr order"
1318: .Pq mdoc
1319: In the SEE ALSO section, an
1320: .Ic \&Xr
1321: macro with a lower section number follows one with a higher number,
1322: or two
1323: .Ic \&Xr
1.157 schwarze 1324: macros referring to the same section are out of alphabetical order.
1.112 schwarze 1325: .It Sy "unusual Xr punctuation"
1326: .Pq mdoc
1327: In the SEE ALSO section, punctuation between two
1328: .Ic \&Xr
1329: macros differs from a single comma, or there is trailing punctuation
1330: after the last
1331: .Ic \&Xr
1332: macro.
1.111 schwarze 1333: .It Sy "AUTHORS section without An macro"
1334: .Pq mdoc
1335: An AUTHORS sections contains no
1336: .Ic \&An
1337: macros, or only empty ones.
1338: Probably, there are author names lacking markup.
1.106 schwarze 1339: .El
1340: .Ss "Warnings related to macros and nesting"
1341: .Bl -ohang
1342: .It Sy "obsolete macro"
1343: .Pq mdoc
1344: See the
1345: .Xr mdoc 7
1346: manual for replacements.
1.126 schwarze 1347: .It Sy "macro neither callable nor escaped"
1348: .Pq mdoc
1349: The name of a macro that is not callable appears on a macro line.
1350: It is printed verbatim.
1.152 schwarze 1351: If the intention is to call it, move it to its own input line;
1.126 schwarze 1352: otherwise, escape it by prepending
1353: .Sq \e& .
1.106 schwarze 1354: .It Sy "skipping paragraph macro"
1355: In
1356: .Xr mdoc 7
1357: documents, this happens
1358: .Bl -dash -compact
1359: .It
1360: at the beginning and end of sections and subsections
1361: .It
1362: right before non-compact lists and displays
1363: .It
1364: at the end of items in non-column, non-compact lists
1365: .It
1366: and for multiple consecutive paragraph macros.
1367: .El
1368: In
1369: .Xr man 7
1370: documents, it happens
1371: .Bl -dash -compact
1372: .It
1373: for empty
1374: .Ic \&P ,
1375: .Ic \&PP ,
1376: and
1377: .Ic \&LP
1378: macros
1379: .It
1380: for
1381: .Ic \&IP
1382: macros having neither head nor body arguments
1383: .It
1384: for
1385: .Ic \&br
1386: or
1387: .Ic \&sp
1388: right after
1389: .Ic \&SH
1390: or
1391: .Ic \&SS
1392: .El
1393: .It Sy "moving paragraph macro out of list"
1394: .Pq mdoc
1395: A list item in a
1396: .Ic \&Bl
1397: list contains a trailing paragraph macro.
1398: The paragraph macro is moved after the end of the list.
1399: .It Sy "skipping no-space macro"
1400: .Pq mdoc
1401: An input line begins with an
1402: .Ic \&Ns
1.208 schwarze 1403: macro, or the next argument after an
1404: .Ic \&Ns
1405: macro is an isolated closing delimiter.
1.106 schwarze 1406: The macro is ignored.
1407: .It Sy "blocks badly nested"
1408: .Pq mdoc
1409: If two blocks intersect, one should completely contain the other.
1410: Otherwise, rendered output is likely to look strange in any output
1411: format, and rendering in SGML-based output formats is likely to be
1412: outright wrong because such languages do not support badly nested
1413: blocks at all.
1414: Typical examples of badly nested blocks are
1415: .Qq Ic \&Ao \&Bo \&Ac \&Bc
1416: and
1417: .Qq Ic \&Ao \&Bq \&Ac .
1418: In these examples,
1419: .Ic \&Ac
1420: breaks
1421: .Ic \&Bo
1422: and
1423: .Ic \&Bq ,
1424: respectively.
1425: .It Sy "nested displays are not portable"
1426: .Pq mdoc
1427: A
1428: .Ic \&Bd ,
1429: .Ic \&D1 ,
1430: or
1431: .Ic \&Dl
1432: display occurs nested inside another
1433: .Ic \&Bd
1434: display.
1435: This works with
1436: .Nm ,
1437: but fails with most other implementations.
1438: .It Sy "moving content out of list"
1439: .Pq mdoc
1440: A
1441: .Ic \&Bl
1442: list block contains text or macros before the first
1443: .Ic \&It
1444: macro.
1445: The offending children are moved before the beginning of the list.
1.209 schwarze 1446: .It Sy "first macro on line"
1447: Inside a
1448: .Ic \&Bl Fl column
1449: list, a
1450: .Ic \&Ta
1451: macro occurs as the first macro on a line, which is not portable.
1.106 schwarze 1452: .It Sy "line scope broken"
1453: .Pq man
1454: While parsing the next-line scope of the previous macro,
1455: another macro is found that prematurely terminates the previous one.
1456: The previous, interrupted macro is deleted from the parse tree.
1457: .El
1458: .Ss "Warnings related to missing arguments"
1459: .Bl -ohang
1460: .It Sy "skipping empty request"
1.118 schwarze 1461: .Pq roff , eqn
1462: The macro name is missing from a macro definition request,
1463: or an
1464: .Xr eqn 7
1465: control statement or operation keyword lacks its required argument.
1.106 schwarze 1466: .It Sy "conditional request controls empty scope"
1467: .Pq roff
1468: A conditional request is only useful if any of the following
1469: follows it on the same logical input line:
1470: .Bl -dash -compact
1471: .It
1472: The
1473: .Sq \e{
1474: keyword to open a multi-line scope.
1475: .It
1476: A request or macro or some text, resulting in a single-line scope.
1477: .It
1478: The immediate end of the logical line without any intervening whitespace,
1479: resulting in next-line scope.
1480: .El
1481: Here, a conditional request is followed by trailing whitespace only,
1482: and there is no other content on its logical input line.
1483: Note that it doesn't matter whether the logical input line is split
1484: across multiple physical input lines using
1485: .Sq \e
1486: line continuation characters.
1487: This is one of the rare cases
1488: where trailing whitespace is syntactically significant.
1489: The conditional request controls a scope containing whitespace only,
1490: so it is unlikely to have a significant effect,
1491: except that it may control a following
1492: .Ic \&el
1493: clause.
1494: .It Sy "skipping empty macro"
1495: .Pq mdoc
1.147 schwarze 1496: The indicated macro has no arguments and hence no effect.
1497: .It Sy "empty block"
1498: .Pq mdoc , man
1499: A
1500: .Ic \&Bd ,
1501: .Ic \&Bk ,
1502: .Ic \&Bl ,
1503: .Ic \&D1 ,
1504: .Ic \&Dl ,
1505: or
1.263 schwarze 1506: .Ic \&RS
1.147 schwarze 1507: block contains nothing in its body and will produce no output.
1.106 schwarze 1508: .It Sy "empty argument, using 0n"
1509: .Pq mdoc
1510: The required width is missing after
1511: .Ic \&Bd
1512: or
1513: .Ic \&Bl
1514: .Fl offset
1515: or
1.186 schwarze 1516: .Fl width .
1.106 schwarze 1517: .It Sy "missing display type, using -ragged"
1518: .Pq mdoc
1519: The
1520: .Ic \&Bd
1521: macro is invoked without the required display type.
1522: .It Sy "list type is not the first argument"
1523: .Pq mdoc
1524: In a
1525: .Ic \&Bl
1526: macro, at least one other argument precedes the type argument.
1527: The
1528: .Nm
1529: utility copes with any argument order, but some other
1530: .Xr mdoc 7
1531: implementations do not.
1532: .It Sy "missing -width in -tag list, using 8n"
1533: .Pq mdoc
1534: Every
1535: .Ic \&Bl
1536: macro having the
1537: .Fl tag
1538: argument requires
1539: .Fl width ,
1540: too.
1541: .It Sy "missing utility name, using \(dq\(dq"
1542: .Pq mdoc
1543: The
1544: .Ic \&Ex Fl std
1545: macro is called without an argument before
1546: .Ic \&Nm
1547: has first been called with an argument.
1.146 schwarze 1548: .It Sy "missing function name, using \(dq\(dq"
1549: .Pq mdoc
1550: The
1551: .Ic \&Fo
1552: macro is called without an argument.
1553: No function name is printed.
1.106 schwarze 1554: .It Sy "empty head in list item"
1555: .Pq mdoc
1556: In a
1557: .Ic \&Bl
1558: .Fl diag ,
1559: .Fl hang ,
1560: .Fl inset ,
1561: .Fl ohang ,
1562: or
1563: .Fl tag
1564: list, an
1565: .Ic \&It
1566: macro lacks the required argument.
1567: The item head is left empty.
1568: .It Sy "empty list item"
1569: .Pq mdoc
1570: In a
1571: .Ic \&Bl
1572: .Fl bullet ,
1573: .Fl dash ,
1574: .Fl enum ,
1575: or
1576: .Fl hyphen
1577: list, an
1578: .Ic \&It
1579: block is empty.
1580: An empty list item is shown.
1.209 schwarze 1581: .It Sy "missing argument, using next line"
1582: .Pq mdoc
1583: An
1584: .Ic \&It
1585: macro in a
1586: .Ic \&Bd Fl column
1587: list has no arguments.
1588: While
1589: .Nm
1590: uses the text or macros of the following line, if any, for the cell,
1591: other formatters may misformat the list.
1.152 schwarze 1592: .It Sy "missing font type, using \efR"
1.106 schwarze 1593: .Pq mdoc
1594: A
1595: .Ic \&Bf
1596: macro has no argument.
1.152 schwarze 1597: It switches to the default font.
1598: .It Sy "unknown font type, using \efR"
1.106 schwarze 1599: .Pq mdoc
1600: The
1601: .Ic \&Bf
1602: argument is invalid.
1.152 schwarze 1603: The default font is used instead.
1.127 schwarze 1604: .It Sy "nothing follows prefix"
1605: .Pq mdoc
1606: A
1607: .Ic \&Pf
1608: macro has no argument, or only one argument and no macro follows
1609: on the same input line.
1610: This defeats its purpose; in particular, spacing is not suppressed
1611: before the text or macros following on the next input line.
1.143 schwarze 1612: .It Sy "empty reference block"
1613: .Pq mdoc
1614: An
1615: .Ic \&Rs
1616: macro is immediately followed by an
1617: .Ic \&Re
1618: macro on the next input line.
1619: Such an empty block does not produce any output.
1.165 schwarze 1620: .It Sy "missing section argument"
1.266 ! schwarze 1621: .Pq mdoc , man
1.165 schwarze 1622: An
1623: .Ic \&Xr
1.266 ! schwarze 1624: or
! 1625: .Ic \&MR
1.165 schwarze 1626: macro lacks its second, section number argument.
1.266 ! schwarze 1627: The first argument, i.e. the name, is printed, but without a section number.
! 1628: In the case of
! 1629: .Ic \&Xr ,
! 1630: the parentheses are also omitted.
1.106 schwarze 1631: .It Sy "missing -std argument, adding it"
1632: .Pq mdoc
1633: An
1634: .Ic \&Ex
1635: or
1636: .Ic \&Rv
1637: macro lacks the required
1638: .Fl std
1639: argument.
1640: The
1641: .Nm
1642: utility assumes
1643: .Fl std
1644: even when it is not specified, but other implementations may not.
1.150 schwarze 1645: .It Sy "missing option string, using \(dq\(dq"
1646: .Pq man
1647: The
1648: .Ic \&OP
1649: macro is invoked without any argument.
1650: An empty pair of square brackets is shown.
1651: .It Sy "missing resource identifier, using \(dq\(dq"
1652: .Pq man
1653: The
1.206 schwarze 1654: .Ic \&MT
1655: or
1.150 schwarze 1656: .Ic \&UR
1657: macro is invoked without any argument.
1658: An empty pair of angle brackets is shown.
1.118 schwarze 1659: .It Sy "missing eqn box, using \(dq\(dq"
1660: .Pq eqn
1661: A diacritic mark or a binary operator is found,
1662: but there is nothing to the left of it.
1663: An empty box is inserted.
1.106 schwarze 1664: .El
1665: .Ss "Warnings related to bad macro arguments"
1666: .Bl -ohang
1667: .It Sy "duplicate argument"
1668: .Pq mdoc
1669: A
1670: .Ic \&Bd
1671: or
1672: .Ic \&Bl
1673: macro has more than one
1674: .Fl compact ,
1675: more than one
1676: .Fl offset ,
1677: or more than one
1678: .Fl width
1679: argument.
1680: All but the last instances of these arguments are ignored.
1681: .It Sy "skipping duplicate argument"
1682: .Pq mdoc
1683: An
1684: .Ic \&An
1685: macro has more than one
1686: .Fl split
1687: or
1688: .Fl nosplit
1689: argument.
1690: All but the first of these arguments are ignored.
1691: .It Sy "skipping duplicate display type"
1692: .Pq mdoc
1693: A
1694: .Ic \&Bd
1695: macro has more than one type argument; the first one is used.
1696: .It Sy "skipping duplicate list type"
1697: .Pq mdoc
1698: A
1699: .Ic \&Bl
1700: macro has more than one type argument; the first one is used.
1701: .It Sy "skipping -width argument"
1702: .Pq mdoc
1703: A
1704: .Ic \&Bl
1705: .Fl column ,
1706: .Fl diag ,
1707: .Fl ohang ,
1708: .Fl inset ,
1709: or
1710: .Fl item
1711: list has a
1712: .Fl width
1713: argument.
1714: That has no effect.
1.151 schwarze 1715: .It Sy "wrong number of cells"
1716: In a line of a
1717: .Ic \&Bl Fl column
1718: list, the number of tabs or
1719: .Ic \&Ta
1720: macros is less than the number expected from the list header line
1721: or exceeds the expected number by more than one.
1722: Missing cells remain empty, and all cells exceeding the number of
1723: columns are joined into one single cell.
1.106 schwarze 1724: .It Sy "unknown AT&T UNIX version"
1725: .Pq mdoc
1726: An
1727: .Ic \&At
1728: macro has an invalid argument.
1729: It is used verbatim, with
1730: .Qq "AT&T UNIX "
1731: prefixed to it.
1.113 schwarze 1732: .It Sy "comma in function argument"
1733: .Pq mdoc
1734: An argument of an
1735: .Ic \&Fa
1736: or
1737: .Ic \&Fn
1738: macro contains a comma; it should probably be split into two arguments.
1.117 schwarze 1739: .It Sy "parenthesis in function name"
1740: .Pq mdoc
1741: The first argument of an
1742: .Ic \&Fc
1743: or
1744: .Ic \&Fn
1745: macro contains an opening or closing parenthesis; that's probably wrong,
1746: parentheses are added automatically.
1.196 schwarze 1747: .It Sy "unknown library name"
1748: .Pq mdoc, not on Ox
1749: An
1750: .Ic \&Lb
1751: macro has an unknown name argument and will be rendered as
1752: .Qq library Dq Ar name .
1.106 schwarze 1753: .It Sy "invalid content in Rs block"
1754: .Pq mdoc
1755: An
1756: .Ic \&Rs
1757: block contains plain text or non-% macros.
1758: The bogus content is left in the syntax tree.
1759: Formatting may be poor.
1760: .It Sy "invalid Boolean argument"
1761: .Pq mdoc
1762: An
1763: .Ic \&Sm
1764: macro has an argument other than
1765: .Cm on
1766: or
1767: .Cm off .
1768: The invalid argument is moved out of the macro, which leaves the macro
1769: empty, causing it to toggle the spacing mode.
1.228 schwarze 1770: .It Sy "argument contains two font escapes"
1771: .Pq roff
1772: The second argument of a
1773: .Ic char
1774: request contains more than one font escape sequence.
1775: A wrong font may remain active after using the character.
1.106 schwarze 1776: .It Sy "unknown font, skipping request"
1.115 schwarze 1777: .Pq man , tbl
1.106 schwarze 1778: A
1779: .Xr roff 7
1780: .Ic \&ft
1.115 schwarze 1781: request or a
1782: .Xr tbl 7
1783: .Ic \&f
1784: layout modifier has an unknown
1785: .Ar font
1786: argument.
1.258 schwarze 1787: .It Sy "ignoring distance argument"
1788: .Pq roff
1789: In addition to the margin character, an
1790: .Ic \&mc
1791: request has a second argument supposed to represent a distance, but the
1792: .Nm
1793: implementation of
1794: .Ic \&mc
1795: always ignores the second argument.
1.151 schwarze 1796: .It Sy "odd number of characters in request"
1797: .Pq roff
1798: A
1799: .Ic \&tr
1800: request contains an odd number of characters.
1801: The last character is mapped to the blank character.
1.106 schwarze 1802: .El
1803: .Ss "Warnings related to plain text"
1804: .Bl -ohang
1805: .It Sy "blank line in fill mode, using .sp"
1806: .Pq mdoc
1807: The meaning of blank input lines is only well-defined in non-fill mode:
1808: In fill mode, line breaks of text input lines are not supposed to be
1809: significant.
1810: However, for compatibility with groff, blank lines in fill mode
1.238 schwarze 1811: are formatted like
1.106 schwarze 1812: .Ic \&sp
1813: requests.
1.238 schwarze 1814: To request a paragraph break, use
1815: .Ic \&Pp
1816: instead of a blank line.
1.106 schwarze 1817: .It Sy "tab in filled text"
1818: .Pq mdoc , man
1819: The meaning of tab characters is only well-defined in non-fill mode:
1820: In fill mode, whitespace is not supposed to be significant
1821: on text input lines.
1822: As an implementation dependent choice, tab characters on text lines
1823: are passed through to the formatters in any case.
1824: Given that the text before the tab character will be filled,
1825: it is hard to predict which tab stop position the tab will advance to.
1.172 schwarze 1826: .It Sy "new sentence, new line"
1827: .Pq mdoc
1828: A new sentence starts in the middle of a text line.
1829: Start it on a new input line to help formatters produce correct spacing.
1.260 schwarze 1830: .It Sy "invalid escape sequence argument"
1.106 schwarze 1831: .Pq roff
1.260 schwarze 1832: The argument of an escape sequence is of an invalid form.
1.259 schwarze 1833: Invalid escape sequences are ignored.
1.232 schwarze 1834: .It Sy "undefined escape, printing literally"
1835: .Pq roff
1836: In an escape sequence, the first character
1837: right after the leading backslash is invalid.
1838: That character is printed literally,
1839: which is equivalent to ignoring the backslash.
1.106 schwarze 1840: .It Sy "undefined string, using \(dq\(dq"
1841: .Pq roff
1842: If a string is used without being defined before,
1843: its value is implicitly set to the empty string.
1844: However, defining strings explicitly before use
1845: keeps the code more readable.
1846: .El
1.138 schwarze 1847: .Ss "Warnings related to tables"
1848: .Bl -ohang
1849: .It Sy "tbl line starts with span"
1850: .Pq tbl
1851: The first cell in a table layout line is a horizontal span
1852: .Pq Sq Cm s .
1853: Data provided for this cell is ignored, and nothing is printed in the cell.
1854: .It Sy "tbl column starts with span"
1855: .Pq tbl
1856: The first line of a table layout specification
1857: requests a vertical span
1858: .Pq Sq Cm ^ .
1859: Data provided for this cell is ignored, and nothing is printed in the cell.
1860: .It Sy "skipping vertical bar in tbl layout"
1861: .Pq tbl
1862: A table layout specification contains more than two consecutive vertical bars.
1863: A double bar is printed, all additional bars are discarded.
1.106 schwarze 1864: .El
1865: .Ss "Errors related to tables"
1.136 schwarze 1866: .Bl -ohang
1867: .It Sy "non-alphabetic character in tbl options"
1868: .Pq tbl
1869: The table options line contains a character other than a letter,
1870: blank, or comma where the beginning of an option name is expected.
1871: The character is ignored.
1872: .It Sy "skipping unknown tbl option"
1873: .Pq tbl
1874: The table options line contains a string of letters that does not
1875: match any known option name.
1876: The word is ignored.
1877: .It Sy "missing tbl option argument"
1878: .Pq tbl
1879: A table option that requires an argument is not followed by an
1880: opening parenthesis, or the opening parenthesis is immediately
1881: followed by a closing parenthesis.
1882: The option is ignored.
1883: .It Sy "wrong tbl option argument size"
1884: .Pq tbl
1885: A table option argument contains an invalid number of characters.
1886: Both the option and the argument are ignored.
1.138 schwarze 1887: .It Sy "empty tbl layout"
1888: .Pq tbl
1889: A table layout specification is completely empty,
1890: specifying zero lines and zero columns.
1891: As a fallback, a single left-justified column is used.
1892: .It Sy "invalid character in tbl layout"
1893: .Pq tbl
1894: A table layout specification contains a character that can neither
1895: be interpreted as a layout key character nor as a layout modifier,
1896: or a modifier precedes the first key.
1897: The invalid character is discarded.
1898: .It Sy "unmatched parenthesis in tbl layout"
1899: .Pq tbl
1900: A table layout specification contains an opening parenthesis,
1901: but no matching closing parenthesis.
1902: The rest of the input line, starting from the parenthesis, has no effect.
1.248 schwarze 1903: .It Sy "ignoring excessive spacing in tbl layout"
1904: .Pq tbl
1905: A spacing modifier in a table layout is unreasonably large.
1906: The default spacing of 3n is used instead.
1.139 schwarze 1907: .It Sy "tbl without any data cells"
1908: .Pq tbl
1909: A table does not contain any data cells.
1910: It will probably produce no output.
1911: .It Sy "ignoring data in spanned tbl cell"
1912: .Pq tbl
1913: A table cell is marked as a horizontal span
1914: .Pq Sq Cm s
1915: or vertical span
1916: .Pq Sq Cm ^
1917: in the table layout, but it contains data.
1918: The data is ignored.
1919: .It Sy "ignoring extra tbl data cells"
1920: .Pq tbl
1921: A data line contains more cells than the corresponding layout line.
1922: The data in the extra cells is ignored.
1923: .It Sy "data block open at end of tbl"
1924: .Pq tbl
1925: A data block is opened with
1926: .Cm T{ ,
1927: but never closed with a matching
1928: .Cm T} .
1929: The remaining data lines of the table are all put into one cell,
1930: and any remaining cells stay empty.
1.106 schwarze 1931: .El
1932: .Ss "Errors related to roff, mdoc, and man code"
1933: .Bl -ohang
1.215 schwarze 1934: .It Sy "duplicate prologue macro"
1935: .Pq mdoc
1936: One of the prologue macros occurs more than once.
1937: The last instance overrides all previous ones.
1938: .It Sy "skipping late title macro"
1939: .Pq mdoc
1940: The
1941: .Ic \&Dt
1942: macro appears after the first non-prologue macro.
1943: Traditional formatters cannot handle this because
1944: they write the page header before parsing the document body.
1945: Even though this technical restriction does not apply to
1946: .Nm ,
1947: traditional semantics is preserved.
1948: The late macro is discarded including its arguments.
1.106 schwarze 1949: .It Sy "input stack limit exceeded, infinite loop?"
1950: .Pq roff
1951: Explicit recursion limits are implemented for the following features,
1952: in order to prevent infinite loops:
1953: .Bl -dash -compact
1954: .It
1955: expansion of nested escape sequences
1956: including expansion of strings and number registers,
1957: .It
1958: expansion of nested user-defined macros,
1959: .It
1960: and
1961: .Ic \&so
1962: file inclusion.
1963: .El
1964: When a limit is hit, the output is incorrect, typically losing
1965: some content, but the parser can continue.
1966: .It Sy "skipping bad character"
1967: .Pq mdoc , man , roff
1968: The input file contains a byte that is not a printable
1969: .Xr ascii 7
1970: character.
1971: The message mentions the character number.
1972: The offending byte is replaced with a question mark
1973: .Pq Sq \&? .
1974: Consider editing the input file to replace the byte with an ASCII
1975: transliteration of the intended character.
1976: .It Sy "skipping unknown macro"
1977: .Pq mdoc , man , roff
1978: The first identifier on a request or macro line is neither recognized as a
1979: .Xr roff 7
1980: request, nor as a user-defined macro, nor, respectively, as an
1981: .Xr mdoc 7
1982: or
1983: .Xr man 7
1984: macro.
1985: It may be mistyped or unsupported.
1986: The request or macro is discarded including its arguments.
1.227 schwarze 1987: .It Sy "skipping request outside macro"
1988: .Pq roff
1989: A
1990: .Ic shift
1991: or
1992: .Ic return
1993: request occurs outside any macro definition and has no effect.
1.133 schwarze 1994: .It Sy "skipping insecure request"
1995: .Pq roff
1996: An input file attempted to run a shell command
1997: or to read or write an external file.
1998: Such attempts are denied for security reasons.
1.106 schwarze 1999: .It Sy "skipping item outside list"
1.118 schwarze 2000: .Pq mdoc , eqn
1.106 schwarze 2001: An
2002: .Ic \&It
2003: macro occurs outside any
2004: .Ic \&Bl
1.118 schwarze 2005: list, or an
2006: .Xr eqn 7
2007: .Ic above
2008: delimiter occurs outside any pile.
1.106 schwarze 2009: It is discarded including its arguments.
2010: .It Sy "skipping column outside column list"
2011: .Pq mdoc
2012: A
2013: .Ic \&Ta
2014: macro occurs outside any
2015: .Ic \&Bl Fl column
2016: block.
2017: It is discarded including its arguments.
2018: .It Sy "skipping end of block that is not open"
2019: .Pq mdoc , man , eqn , tbl , roff
2020: Various syntax elements can only be used to explicitly close blocks
2021: that have previously been opened.
2022: An
2023: .Xr mdoc 7
2024: block closing macro, a
2025: .Xr man 7
1.206 schwarze 2026: .Ic \&ME , \&RE
1.106 schwarze 2027: or
2028: .Ic \&UE
1.118 schwarze 2029: macro, an
2030: .Xr eqn 7
2031: right delimiter or closing brace, or the end of an equation, table, or
1.106 schwarze 2032: .Xr roff 7
2033: conditional request is encountered but no matching block is open.
2034: The offending request or macro is discarded.
1.135 schwarze 2035: .It Sy "fewer RS blocks open, skipping"
2036: .Pq man
2037: The
2038: .Ic \&RE
2039: macro is invoked with an argument, but less than the specified number of
2040: .Ic \&RS
2041: blocks is open.
2042: The
2043: .Ic \&RE
2044: macro is discarded.
1.106 schwarze 2045: .It Sy "inserting missing end of block"
2046: .Pq mdoc , tbl
2047: Various
2048: .Xr mdoc 7
2049: macros as well as tables require explicit closing by dedicated macros.
2050: A block that doesn't support bad nesting
2051: ends before all of its children are properly closed.
2052: The open child nodes are closed implicitly.
1.152 schwarze 2053: .It Sy "appending missing end of block"
1.106 schwarze 2054: .Pq mdoc , man , eqn , tbl , roff
2055: At the end of the document, an explicit
2056: .Xr mdoc 7
2057: block, a
2058: .Xr man 7
2059: next-line scope or
1.206 schwarze 2060: .Ic \&MT , \&RS
1.106 schwarze 2061: or
2062: .Ic \&UR
2063: block, an equation, table, or
2064: .Xr roff 7
2065: conditional or ignore block is still open.
2066: The open block is closed implicitly.
2067: .It Sy "escaped character not allowed in a name"
2068: .Pq roff
2069: Macro, string and register identifiers consist of printable,
2070: non-whitespace ASCII characters.
2071: Escape sequences and characters and strings expressed in terms of them
2072: cannot form part of a name.
2073: The first argument of an
2074: .Ic \&am ,
2075: .Ic \&as ,
2076: .Ic \&de ,
2077: .Ic \&ds ,
2078: .Ic \&nr ,
2079: or
2080: .Ic \&rr
2081: request, or any argument of an
2082: .Ic \&rm
2083: request, or the name of a request or user defined macro being called,
2084: is terminated by an escape sequence.
2085: In the cases of
2086: .Ic \&as ,
2087: .Ic \&ds ,
2088: and
2089: .Ic \&nr ,
2090: the request has no effect at all.
2091: In the cases of
2092: .Ic \&am ,
2093: .Ic \&de ,
2094: .Ic \&rr ,
2095: and
2096: .Ic \&rm ,
2097: what was parsed up to this point is used as the arguments to the request,
2098: and the rest of the input line is discarded including the escape sequence.
2099: When parsing for a request or a user-defined macro name to be called,
2100: only the escape sequence is discarded.
2101: The characters preceding it are used as the request or macro name,
2102: the characters following it are used as the arguments to the request or macro.
1.227 schwarze 2103: .It Sy "using macro argument outside macro"
2104: .Pq roff
2105: The escape sequence \e$ occurs outside any macro definition
2106: and expands to the empty string.
2107: .It Sy "argument number is not numeric"
2108: .Pq roff
2109: The argument of the escape sequence \e$ is not a digit;
2110: the escape sequence expands to the empty string.
1.257 schwarze 2111: .It Sy "negative argument, using 0"
2112: .Pq roff
2113: A
2114: .Ic \&shift
2115: request has a negative argument
2116: or an argument that is negative due to integer overflow.
2117: Macro argument numbering remains unchanged.
1.124 schwarze 2118: .It Sy "NOT IMPLEMENTED: Bd -file"
2119: .Pq mdoc
2120: For security reasons, the
2121: .Ic \&Bd
2122: macro does not support the
2123: .Fl file
2124: argument.
2125: By requesting the inclusion of a sensitive file, a malicious document
2126: might otherwise trick a privileged user into inadvertently displaying
2127: the file on the screen, revealing the file content to bystanders.
2128: The argument is ignored including the file name following it.
1.163 schwarze 2129: .It Sy "skipping display without arguments"
2130: .Pq mdoc
2131: A
2132: .Ic \&Bd
2133: block macro does not have any arguments.
2134: The block is discarded, and the block content is displayed in
2135: whatever mode was active before the block.
1.106 schwarze 2136: .It Sy "missing list type, using -item"
2137: .Pq mdoc
2138: A
2139: .Ic \&Bl
2140: macro fails to specify the list type.
1.194 schwarze 2141: .It Sy "argument is not numeric, using 1"
2142: .Pq roff
2143: The argument of a
2144: .Ic \&ce
2145: request is not a number.
1.228 schwarze 2146: .It Sy "argument is not a character"
2147: .Pq roff
2148: The first argument of a
2149: .Ic char
2150: request is neither a single ASCII character
2151: nor a single character escape sequence.
2152: The request is ignored including all its arguments.
1.258 schwarze 2153: .It Sy "skipping unusable escape sequence"
2154: .Pq roff
2155: The first argument of an
2156: .Ic mc
2157: request is neither a single ASCII character
2158: nor a single character escape sequence.
2159: All arguments are ignored and printing of a margin character is disabled.
1.106 schwarze 2160: .It Sy "missing manual name, using \(dq\(dq"
1.266 ! schwarze 2161: .Pq mdoc , man
1.106 schwarze 2162: The first call to
1.168 schwarze 2163: .Ic \&Nm ,
1.266 ! schwarze 2164: or any call in the NAME section, lacks the required argument, or
! 2165: .Ic \&MR
! 2166: is called without any argument.
1.106 schwarze 2167: .It Sy "uname(3) system call failed, using UNKNOWN"
2168: .Pq mdoc
2169: The
2170: .Ic \&Os
2171: macro is called without arguments, and the
2172: .Xr uname 3
2173: system call failed.
2174: As a workaround,
2175: .Nm
2176: can be compiled with
2177: .Sm off
2178: .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq .
2179: .Sm on
2180: .It Sy "unknown standard specifier"
2181: .Pq mdoc
2182: An
2183: .Ic \&St
2184: macro has an unknown argument and is discarded.
2185: .It Sy "skipping request without numeric argument"
1.118 schwarze 2186: .Pq roff , eqn
1.106 schwarze 2187: An
2188: .Ic \&it
1.118 schwarze 2189: request or an
2190: .Xr eqn 7
2191: .Ic \&size
2192: or
2193: .Ic \&gsize
2194: statement has a non-numeric or negative argument or no argument at all.
2195: The invalid request or statement is ignored.
1.227 schwarze 2196: .It Sy "excessive shift"
2197: .Pq roff
2198: The argument of a
2199: .Ic shift
2200: request is larger than the number of arguments of the macro that is
2201: currently being executed.
2202: All macro arguments are deleted and \en(.$ is set to zero.
1.132 schwarze 2203: .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
2204: .Pq roff
2205: For security reasons,
2206: .Nm
2207: allows
2208: .Ic \&so
2209: file inclusion requests only with relative paths
2210: and only without ascending to any parent directory.
2211: By requesting the inclusion of a sensitive file, a malicious document
2212: might otherwise trick a privileged user into inadvertently displaying
2213: the file on the screen, revealing the file content to bystanders.
2214: .Nm
2215: only shows the path as it appears behind
2216: .Ic \&so .
2217: .It Sy ".so request failed"
2218: .Pq roff
2219: Servicing a
2220: .Ic \&so
2221: request requires reading an external file, but the file could not be
2222: opened.
2223: .Nm
2224: only shows the path as it appears behind
2225: .Ic \&so .
1.106 schwarze 2226: .It Sy "skipping all arguments"
2227: .Pq mdoc , man , eqn , roff
2228: An
2229: .Xr mdoc 7
2230: .Ic \&Bt ,
2231: .Ic \&Ed ,
2232: .Ic \&Ef ,
2233: .Ic \&Ek ,
2234: .Ic \&El ,
1.144 schwarze 2235: .Ic \&Lp ,
2236: .Ic \&Pp ,
1.106 schwarze 2237: .Ic \&Re ,
1.143 schwarze 2238: .Ic \&Rs ,
1.106 schwarze 2239: or
2240: .Ic \&Ud
2241: macro, an
2242: .Ic \&It
2243: macro in a list that don't support item heads, a
2244: .Xr man 7
2245: .Ic \&LP ,
2246: .Ic \&P ,
2247: or
2248: .Ic \&PP
2249: macro, an
2250: .Xr eqn 7
1.120 schwarze 2251: .Ic \&EQ
2252: or
1.106 schwarze 2253: .Ic \&EN
2254: macro, or a
2255: .Xr roff 7
1.148 schwarze 2256: .Ic \&br ,
2257: .Ic \&fi ,
2258: or
2259: .Ic \&nf
1.144 schwarze 2260: request or
1.106 schwarze 2261: .Sq \&..
2262: block closing request is invoked with at least one argument.
2263: All arguments are ignored.
2264: .It Sy "skipping excess arguments"
1.135 schwarze 2265: .Pq mdoc , man , roff
1.150 schwarze 2266: A macro or request is invoked with too many arguments:
2267: .Bl -dash -offset 2n -width 2n -compact
2268: .It
2269: .Ic \&Fo ,
1.206 schwarze 2270: .Ic \&MT ,
1.150 schwarze 2271: .Ic \&PD ,
2272: .Ic \&RS ,
2273: .Ic \&UR ,
2274: .Ic \&ft ,
2275: or
2276: .Ic \&sp
2277: with more than one argument
2278: .It
1.144 schwarze 2279: .Ic \&An
1.150 schwarze 2280: with another argument after
1.144 schwarze 2281: .Fl split
2282: or
1.150 schwarze 2283: .Fl nosplit
2284: .It
2285: .Ic \&RE
2286: with more than one argument or with a non-integer argument
2287: .It
2288: .Ic \&OP
2289: or a request of the
2290: .Ic \&de
2291: family with more than two arguments
1.154 schwarze 2292: .It
2293: .Ic \&Dt
1.266 ! schwarze 2294: or
! 2295: .Ic \&MR
1.154 schwarze 2296: with more than three arguments
1.150 schwarze 2297: .It
2298: .Ic \&TH
2299: with more than five arguments
2300: .It
1.145 schwarze 2301: .Ic \&Bd ,
2302: .Ic \&Bk ,
2303: or
2304: .Ic \&Bl
1.150 schwarze 2305: with invalid arguments
2306: .El
1.106 schwarze 2307: The excess arguments are ignored.
1.259 schwarze 2308: .El
2309: .Ss "Errors related to escape sequences"
2310: .Bl -ohang
2311: .It Sy "incomplete escape sequence"
2312: .Pq roff
2313: The end of the input line is encountered
2314: while parsing the argument of an escape sequence.
2315: In this case,
2316: .Ic \e*
2317: and
2318: .Ic \en
2319: expand to an empty string,
2320: .Ic \eB
2321: to the digit
2322: .Sq 0 ,
2323: and
2324: .Ic \ew
2325: to the length of the incomplete argument.
2326: All other incomplete escape sequences are ignored.
2327: .It Sy "invalid special character"
2328: .Pq roff
2329: A special character escape sequence is invalid,
2330: for example a Unicode sequence pointing to a surrogate
2331: or beyond the Unicode range, a \e[char...] escape sequence
2332: representing a control character or pointing beyond the
2333: .Vt unsigned char
2334: range, or an invalid variable-length form
2335: of a single-byte character escape sequence, for example writing
2336: .Qq \e[e]
2337: or
2338: .Qq \e[~]
2339: instead of
2340: .Qq \ee
2341: or
2342: .Qq \e~ ,
2343: respectively.
2344: The escape sequence is ignored.
2345: .It Sy "unknown special character"
2346: .Pq roff
2347: The name given in a special character escape sequence is not known to
2348: .Nm .
2349: The escape sequence is ignored.
1.260 schwarze 2350: .It Sy "invalid escape argument delimiter"
2351: .Pq roff
2352: An escape sequence that expects a numerical argument
2353: attempts to employ one of the characters
2354: .Qq " %&()*+-./0123456789:<=>"
2355: as an argument delimiter.
2356: The escape sequence is ignored including the invalid opening delimiter
2357: and the rest of the argument may appear as output text.
1.262 schwarze 2358: While various characters can be used as argument delimiters,
1.260 schwarze 2359: using the apostrophe-quote character
2360: .Pq Sq \(aq
2361: is recommended for readability and robustness.
1.133 schwarze 2362: .El
2363: .Ss Unsupported features
2364: .Bl -ohang
2365: .It Sy "input too large"
2366: .Pq mdoc , man
2367: Currently,
2368: .Nm
2369: cannot handle input files larger than its arbitrary size limit
2370: of 2^31 bytes (2 Gigabytes).
2371: Since useful manuals are always small, this is not a problem in practice.
2372: Parsing is aborted as soon as the condition is detected.
1.136 schwarze 2373: .It Sy "unsupported control character"
2374: .Pq roff
2375: An ASCII control character supported by other
2376: .Xr roff 7
2377: implementations but not by
2378: .Nm
2379: was found in an input file.
2380: It is replaced by a question mark.
1.232 schwarze 2381: .It Sy "unsupported escape sequence"
2382: .Pq roff
2383: An input file contains an escape sequence supported by GNU troff
2384: or Heirloom troff but not by
2385: .Nm ,
2386: and it is likely that this will cause information loss
2387: or considerable misformatting.
1.133 schwarze 2388: .It Sy "unsupported roff request"
2389: .Pq roff
2390: An input file contains a
2391: .Xr roff 7
2392: request supported by GNU troff or Heirloom troff but not by
2393: .Nm ,
2394: and it is likely that this will cause information loss
2395: or considerable misformatting.
1.139 schwarze 2396: .It Sy "eqn delim option in tbl"
2397: .Pq eqn , tbl
2398: The options line of a table defines equation delimiters.
2399: Any equation source code contained in the table will be printed unformatted.
2400: .It Sy "unsupported table layout modifier"
1.138 schwarze 2401: .Pq tbl
2402: A table layout specification contains an
2403: .Sq Cm m
2404: modifier.
2405: The modifier is discarded.
1.133 schwarze 2406: .It Sy "ignoring macro in table"
1.139 schwarze 2407: .Pq tbl , mdoc , man
2408: A table contains an invocation of an
2409: .Xr mdoc 7
2410: or
2411: .Xr man 7
2412: macro or of an undefined macro.
2413: The macro is ignored, and its arguments are handled
2414: as if they were a text line.
1.252 schwarze 2415: .It Sy "skipping tbl in -Tman mode"
2416: .Pq mdoc , tbl
2417: An input file contains the
2418: .Ic \&TS
2419: macro.
2420: This message is only generated in
2421: .Fl T Cm man
2422: output mode, where
2423: .Xr tbl 7
2424: input is not supported.
2425: .It Sy "skipping eqn in -Tman mode"
2426: .Pq mdoc , eqn
2427: An input file contains the
2428: .Ic \&EQ
2429: macro.
2430: This message is only generated in
2431: .Fl T Cm man
2432: output mode, where
2433: .Xr eqn 7
2434: input is not supported.
1.240 schwarze 2435: .El
2436: .Ss Bad command line arguments
2437: .Bl -ohang
2438: .It Sy "bad command line argument"
2439: The argument following one of the
2440: .Fl IKMmOTW
2441: command line options is invalid, or a
2442: .Ar file
2443: given as a command line argument cannot be opened.
2444: .It Sy "duplicate command line argument"
2445: The
2446: .Fl I
2447: command line option was specified twice.
2448: .It Sy "option has a superfluous value"
2449: An argument to the
2450: .Fl O
2451: option has a value but does not accept one.
2452: .It Sy "missing option value"
2453: An argument to the
2454: .Fl O
2455: option has no argument but requires one.
2456: .It Sy "bad option value"
2457: An argument to the
2458: .Fl O
2459: .Cm indent
2460: or
2461: .Cm width
2462: option has an invalid value.
2463: .It Sy "duplicate option value"
2464: The same
2465: .Fl O
2466: option is specified more than once.
2467: .It Sy "no such tag"
2468: The
2469: .Fl O Cm tag
2470: option was specified but the tag was not found in any of the displayed
2471: manual pages.
1.253 schwarze 2472: .It Sy "\-Tmarkdown unsupported for man(7) input"
2473: .Pq man
2474: The
2475: .Fl T Cm markdown
2476: option was specified but an input file uses the
2477: .Xr man 7
2478: language.
2479: No output is produced for that input file.
1.106 schwarze 2480: .El
1.1 kristaps 2481: .Sh SEE ALSO
1.141 schwarze 2482: .Xr apropos 1 ,
2483: .Xr man 1 ,
1.85 kristaps 2484: .Xr eqn 7 ,
1.57 kristaps 2485: .Xr man 7 ,
1.13 kristaps 2486: .Xr mandoc_char 7 ,
1.84 kristaps 2487: .Xr mdoc 7 ,
2488: .Xr roff 7 ,
2489: .Xr tbl 7
1.173 schwarze 2490: .Sh HISTORY
2491: The
2492: .Nm
2493: utility first appeared in
2494: .Ox 4.8 .
2495: The option
2496: .Fl I
2497: appeared in
2498: .Ox 5.2 ,
2499: and
2500: .Fl aCcfhKklMSsw
2501: in
2502: .Ox 5.7 .
1.1 kristaps 2503: .Sh AUTHORS
1.156 schwarze 2504: .An -nosplit
1.1 kristaps 2505: The
2506: .Nm
1.26 kristaps 2507: utility was written by
1.141 schwarze 2508: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
2509: and is maintained by
2510: .An Ingo Schwarze Aq Mt schwarze@openbsd.org .
CVSweb