1 .\" $Id: mandoc.1,v 1.58 2010/04/12 19:27:22 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: April 12 2010 $
24 .Nd format and display UNIX manuals
43 manual pages for display.
44 The arguments are as follows:
48 Comma-separated compiler options.
57 for available formats.
62 Comma-separated output options.
71 for available formats.
76 Print version and exit.
79 Comma-separated warning options.
84 for warnings to be considered errors and cause utility
88 arguments may be comma-separated, such as
89 .Fl W Ns Cm error , Ns Cm all .
92 Read input from zero or more files.
93 If unspecified, reads from stdin.
94 If multiple files are specified,
96 will halt with the first failed parse.
106 text from stdin, implying
134 should only be used for legacy manuals.
139 which is also the default, determines encoding on-the-fly: if the first
146 parser is used; otherwise, the
152 files are specified with
154 each has its file-type determined this way.
155 If multiple files are
160 is specified, then this format is used exclusively.
166 utility accepts the following
173 Produce 7-bit ASCII output, backspace-encoded for bold and underline
180 Produce strict HTML-4.01 output, with a sane default style.
185 Parse only: produce no output.
192 Produce an indented parse tree.
195 Produce strict XHTML-1.0 output, with a sane default style.
201 If multiple input files are specified, these will be processed by the
202 corresponding filter in-order.
206 Default compiler behaviour may be overridden with the
211 .It Fl f Ns Cm ign-errors
212 When parsing multiple files, don't halt when one errors out.
215 over a large set of manuals passed on the command line.
217 .It Fl f Ns Cm ign-escape
218 Ignore invalid escape sequences.
219 This is the default, but the option can be used to override an earlier
222 .It Fl f Ns Cm ign-scope
223 When rewinding the scope of a block macro, forces the compiler to ignore
225 This can seriously mangle the resulting tree.
228 .It Fl f Ns Cm no-ign-chars
229 Do not ignore disallowed characters.
231 .It Fl f Ns Cm no-ign-escape
232 Do not ignore invalid escape sequences.
234 .It Fl f Ns Cm no-ign-macro
235 Do not ignore unknown macros at the start of input lines.
237 .It Fl f Ns Cm strict
239 .Fl f Ns Cm no-ign-escape ,
240 .Fl f Ns Cm no-ign-macro ,
242 .Fl f Ns Cm no-ign-chars .
247 For the time being, only
251 accept output options:
253 .It Fl O Ns Cm includes Ns = Ns Ar fmt
258 is used as a template for linked header files (usually via the
263 are replaced with the include filename.
264 The default is not to present a
266 .It Fl O Ns Cm man Ns = Ns Ar fmt
270 .Ar ../html%S/%N.%S.html ,
271 is used as a template for linked manuals (usually via the
278 are replaced with the linked manual's name and section, respectively.
279 If no section is included, section 1 is assumed.
280 The default is not to
282 .It Fl O Ns Cm style Ns = Ns Ar style.css
285 is used for an external style-sheet.
286 This must be a valid absolute or
292 This section documents output details of
294 In general, output conforms to the traditional manual style of a header,
295 a body composed of sections and sub-sections, and a footer.
297 The text style of output characters (non-macro characters, punctuation,
298 and white-space) is dictated by context.
300 White-space is generally stripped from input.
301 This can be changed with
302 character escapes (specified in
304 or literal modes (specified in
309 If non-macro punctuation is set apart from words, such as in the phrase
310 .Dq to be \&, or not to be ,
313 regardless of output format, according to the following rules: opening
321 is not followed by a space; closing punctuation
334 is not preceded by white-space.
339 however, these rules are also applied to macro arguments when appropriate.
345 which is the default, is rendered in standard 7-bit ASCII documented in
348 Font styles are applied by using back-spaced encoding such that an
352 .Sq _ Ns \e[bs] Ns c ,
355 is the back-space character number 8.
356 Emboldened characters are rendered as
357 .Sq c Ns \e[bs] Ns c .
359 The special characters documented in
361 are rendered best-effort in an ASCII equivalent.
363 Output width is limited to 78 visible columns unless literal input lines
370 conforms to HTML-4.01 strict.
372 Font styles and page structure are applied using CSS2.
373 By default, no font style is applied to any text,
374 although CSS2 is hard-coded to format
375 the basic structure of output.
378 .Pa example.style.css
379 file documents the range of styles applied to output and, if used, will
380 cause rendered documents to appear as they do in
383 Special characters are rendered in decimal-encoded UTF-8.
389 conforms to XHTML-1.0 strict.
393 for details; beyond generating XHTML tags instead of HTML tags, these
394 output modes are identical.
398 To page manuals to the terminal:
401 .D1 $ mandoc \-Wall,error \-fstrict mandoc.1 2\*(Gt&1 | less
402 .D1 $ mandoc mandoc.1 mdoc.3 mdoc.7 | less
405 To produce HTML manuals with
409 .D1 $ mandoc \-Thtml -Ostyle=style.css mdoc.7 \*(Gt mdoc.7.html
411 To check over a large set of manuals:
414 .Dl $ mandoc \-Tlint \-fign-errors `find /usr/src -name \e*\e.[1-9]`
418 This section summarises
422 Each input and output format is separately noted.
425 .Ss ASCII Compatibility
430 special character doesn't produce expected behaviour in
442 are synonyms, as are \-filled and \-ragged.
450 macro does not underline when scoped under an
452 in the FILES section.
453 This behaves correctly in
457 A list or display following the
462 does not assert a prior vertical break, just as it doesn't with
474 Words aren't hyphenated.
477 In normal mode (not a literal block), blocks of spaces aren't preserved,
478 so double spaces following sentence closure are reduced to a single space;
483 Sentences are unilaterally monospaced.
487 .Ss HTML/XHTML Compatibility
492 escape will revert the font to the previous
494 escape, not to the last rendered decoration, which is now dictated by
495 CSS instead of hard-coded.
496 It also will not span past the current scope,
500 mode, this will work fine.
507 list types render similarly (no break following overreached left-hand
508 side) due to the expressive constraints of HTML.
516 lists render similarly.
528 utility was written by
529 .An Kristaps Dzonsons Aq kristaps@kth.se .
537 CSS2 styling used for
539 input lists does not render properly in older browsers, such as Internet
540 Explorer 6 and earlier.
547 the maximum size of an element attribute is determined by
549 which is usually 1024 bytes.
550 Be aware of this when setting long link
552 .Fl O Ns Cm style Ns = Ns Ar really/long/link .
559 output modes don't render the
561 font size escape documented in
567 Nesting elements within next-line element scopes of
577 and cause them to forget the formatting of the prior next-line scope.
584 should italicise all subsequent text if a line argument is not provided.
585 This behaviour is not implemented.
589 control character is an alias for the standard macro control character
590 and does not emit a line-break as stipulated in GNU troff.