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