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