1 .\" $Id: mandoc.1,v 1.45 2009/10/26 15:44:51 kristaps Exp $
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: October 26 2009 $
24 .Nd format and display UNIX manuals
29 .Op Fl f Ns Ar option...
31 .Op Fl O Ns Ar option...
43 manual pages for display. The arguments are as follows:
46 .It Fl f Ns Ar option...
47 Comma-separated compiler options. See
54 for available formats. Defaults to
57 .It Fl O Ns Ar option...
58 Comma-separated output options. See
65 for available formats. Defaults to
69 Print version and exit.
72 Comma-separated warning options. Use
76 for warnings to be considered errors and cause utility
79 arguments may be comma-separated, such as
80 .Fl W Ns Ar error,all .
83 Read input from zero or more
85 If unspecified, reads from stdin. If multiple files are specified,
87 will halt with the first failed parse.
97 text from stdin, implying
99 and prints 78-column backspace-encoded output to stdout as if
107 .Ss Punctuation and Spacing
108 If punctuation is set apart from words, such as in the phrase
109 .Dq to be \&, or not to be ,
112 according to the following rules: opening punctuation
119 is not followed by a space; closing punctuation
132 is not preceded by whitespace.
137 these rules are also applied to macro arguments when appropriate.
140 White-space, in non-literal (normal) mode, is stripped from input and
141 replaced on output by a single space. Thus, if you wish to preserve multiple
142 spaces, they must be space-escaped or used in a literal display mode, e.g.,
165 should only be used for legacy manuals.
170 which is also the default, determines encoding on-the-fly: if the first
177 parser is used; otherwise, the
183 files are specified with
185 each has its file-type determined this way. If multiple files are
190 is specified, then this format is used exclusively.
196 utility accepts the following
202 Produce 7-bit ASCII output, backspace-encoded for bold and underline
203 styles. This is the default.
206 Produce strict HTML-4.01 output, with a sane default style.
209 Produce an indented parse tree.
212 Parse only: produce no output.
216 If multiple input files are specified, these will be processed by the
217 corresponding filter in-order.
221 Default compiler behaviour may be overridden with the
226 .It Fl f Ns Ar ign-scope
227 When rewinding the scope of a block macro, forces the compiler to ignore
228 scope violations. This can seriously mangle the resulting tree.
231 .It Fl f Ns Ar ign-escape
232 Ignore invalid escape sequences.
233 This is the default, but the option can be used to override an earlier
236 .It Fl f Ns Ar no-ign-escape
237 Don't ignore invalid escape sequences.
239 .It Fl f Ns Ar no-ign-macro
240 Do not ignore unknown macros at the start of input lines.
242 .It Fl f Ns Ar no-ign-chars
243 Do not ignore disallowed characters.
245 .It Fl f Ns Ar strict
247 .Fl f Ns Ar no-ign-escape ,
248 .Fl f Ns Ar no-ign-macro
250 .Fl f Ns Ar no-ign-chars .
252 .It Fl f Ns Ar ign-errors
253 Don't halt when encountering parse errors. Useful with
255 over a large set of manuals passed on the command line.
259 For the time being, only
261 is the only mode with output options:
263 .It Fl O Ns Ar style=style.css
266 is used for an external style-sheet. This must be a valid absolute or
268 .It Fl O Ns Ar includes=fmt
273 is used as a template for linked header files (usually via the
277 are replaced with the include filename. The default is not to present a
279 .It Fl O Ns Ar man=fmt
283 .Ar ../html%S/%N.%S.html ,
284 is used as a template for linked manuals (usually via the
290 are replaced with the linked manual's name and section, respectively.
291 If no section is included, section 1 is assumed. The default is not to
296 To page manuals to the terminal:
299 .D1 % mandoc \-Wall,error \-fstrict mandoc.1 2>&1 | less
300 .D1 % mandoc mandoc.1 mdoc.3 mdoc.7 | less
303 To produce HTML manuals with
307 .D1 % mandoc \-Thtml -ostyle=style.css mdoc.7 > mdoc.7.html
309 To check over a large set of manuals:
312 .Dl % mandoc \-Tlint \-fign-errors `find /usr/src -name \e*\e.[1-9]`
316 This section summarises
320 Each input and output format is separately noted.
328 special character doesn't produce expected behaviour in
340 are synonyms, as are \-filled and \-ragged.
348 macro does not underline when scoped under an
350 in the FILES section. This behaves correctly in
354 A list or display following
359 does not assert a prior vertical break, just as it doesn't with
371 Words aren't hyphenated.
374 In normal mode (not a literal block), blocks of spaces aren't preserved,
375 so double spaces following sentence closure are reduced to a single space;
380 Sentences are unilaterally monospaced.
391 list types render similarly (no break following overreached left-hand
392 side) due to the expressive constraints of HTML.
400 lists render similarly.
411 utility was written by
412 .An Kristaps Dzonsons Aq kristaps@kth.se .
417 the maximum size of an element attribute is determined by
419 which is usually 1024 bytes. Be aware of this when setting long link
421 .Fl O Ns Ar man=fmt .