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