1 .\" $Id: mandoc.1,v 1.70 2010/07/04 19:24:00 kristaps Exp $
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
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: July 4 2010 $
22 .Nd format and display UNIX manuals
37 manual pages for display.
38 The arguments are as follows:
41 Comma-separated compiler options.
49 for available formats.
53 Comma-separated output options.
58 for available formats.
62 Print version and exit.
64 Comma-separated warning options.
69 for warnings to be considered errors and cause utility
73 arguments may be comma-separated, such as
74 .Fl W Ns Cm error , Ns Cm all .
76 Read input from zero or more files.
77 If unspecified, reads from stdin.
78 If multiple files are specified,
80 will halt with the first failed parse.
89 text from stdin, implying
114 should only be used for legacy manuals.
118 which is also the default, determines encoding on-the-fly: if the first
125 parser is used; otherwise, the
130 files are specified with
132 each has its file-type determined this way.
133 If multiple files are
138 is specified, then this format is used exclusively.
144 compilation behaviour may be overridden with the
148 .It Fl f Ns Cm ign-errors
149 When parsing multiple files, don't halt when one errors out.
152 over a large set of manuals passed on the command line.
153 .It Fl f Ns Cm ign-escape
154 Ignore invalid escape sequences.
155 This is the default, but the option can be used to override an earlier
157 .It Fl f Ns Cm ign-scope
158 When rewinding the scope of a block macro, forces the compiler to ignore
160 This can seriously mangle the resulting tree.
162 .It Fl f Ns Cm no-ign-escape
163 Do not ignore invalid escape sequences.
164 .It Fl f Ns Cm no-ign-macro
165 Do not ignore unknown macros at the start of input lines.
166 .It Fl f Ns Cm strict
168 .Fl f Ns Cm no-ign-escape
170 .Fl f Ns Cm no-ign-macro .
175 utility accepts the following
177 arguments, which correspond to output modes:
180 Produce 7-bit ASCII output, backspace-encoded for bold and underline
186 Produce strict HTML-4.01 output, with a sane default style.
190 Parse only: produce no output.
196 Produce PostScript output.
198 .Sx PostScript Output .
200 Produce an indented parse tree.
202 Produce strict XHTML-1.0 output, with a sane default style.
207 If multiple input files are specified, these will be processed by the
208 corresponding filter in-order.
212 which is the default, is rendered in standard 7-bit ASCII documented in
215 Font styles are applied by using back-spaced encoding such that an
219 .Sq _ Ns \e[bs] Ns c ,
222 is the back-space character number 8.
223 Emboldened characters are rendered as
224 .Sq c Ns \e[bs] Ns c .
226 The special characters documented in
228 are rendered best-effort in an ASCII equivalent.
230 Output width is limited to 78 visible columns unless literal input lines
235 arguments are accepted:
237 .It Cm width Ns = Ns Ar width
238 The output width is set to
240 which will normalise to \(>=60.
245 conforms to HTML-4.01 strict.
247 Font styles and page structure are applied using CSS2.
248 By default, no font style is applied to any text,
249 although CSS2 is hard-coded to format
250 the basic structure of output.
253 .Pa example.style.css
254 file documents the range of styles applied to output and, if used, will
255 cause rendered documents to appear as they do in
258 Special characters are rendered in decimal-encoded UTF-8.
262 arguments are accepted:
264 .It Cm includes Ns = Ns Ar fmt
269 is used as a template for linked header files (usually via the
274 are replaced with the include filename.
275 The default is not to present a
277 .It Cm man Ns = Ns Ar fmt
281 .Ar ../html%S/%N.%S.html ,
282 is used as a template for linked manuals (usually via the
289 are replaced with the linked manual's name and section, respectively.
290 If no section is included, section 1 is assumed.
291 The default is not to
293 .It Cm style Ns = Ns Ar style.css
296 is used for an external style-sheet.
297 This must be a valid absolute or
300 .Ss PostScript Output
303 Level-2 pages may be generated by
305 Output pages default to letter sized and are rendered in the Times font
307 Margins are calculated as 1/9 the page length and width.
309 Special characters are rendered as in
314 arguments are accepted:
316 .It Cm paper Ns = Ns Ar name
326 You may also manually specify dimensions as
328 width by height in millimetres.
329 If an unknown value is encountered,
336 conforms to XHTML-1.0 strict.
340 for details; beyond generating XHTML tags instead of HTML tags, these
341 output modes are identical.
343 To page manuals to the terminal:
345 .D1 $ mandoc \-Wall,error \-fstrict mandoc.1 2\*(Gt&1 | less
346 .D1 $ mandoc mandoc.1 mdoc.3 mdoc.7 | less
348 To produce HTML manuals with
352 .D1 $ mandoc \-Thtml -Ostyle=style.css mdoc.7 \*(Gt mdoc.7.html
354 To check over a large set of manuals:
356 .Dl $ mandoc \-Tlint \-fign-errors `find /usr/src -name \e*\e.[1-9]`
358 To produce a series of PostScript manuals for A4 paper:
360 .D1 $ mandoc \-Tps \-Opaper=a4 mdoc.7 man.7 \*(Gt manuals.ps
362 This section summarises
366 Each input and output format is separately noted.
367 .Ss ASCII Compatibility
372 special character doesn't produce expected behaviour in
383 are synonyms, as are \-filled and \-ragged.
390 macro does not underline when scoped under an
392 in the FILES section.
393 This behaves correctly in
396 A list or display following the
401 does not assert a prior vertical break, just as it doesn't with
411 Words aren't hyphenated.
413 In normal mode (not a literal block), blocks of spaces aren't preserved,
414 so double spaces following sentence closure are reduced to a single space;
418 Sentences are unilaterally monospaced.
420 .Ss HTML/XHTML Compatibility
425 escape will revert the font to the previous
427 escape, not to the last rendered decoration, which is now dictated by
428 CSS instead of hard-coded.
429 It also will not span past the current scope,
433 mode, this will work fine.
440 list types render similarly (no break following overreached left-hand
441 side) due to the expressive constraints of HTML.
448 lists render similarly.
457 utility was written by
458 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
464 CSS2 styling used for
466 input lists does not render properly in older browsers, such as Internet
467 Explorer 6 and earlier.
473 the maximum size of an element attribute is determined by
475 which is usually 1024 bytes.
476 Be aware of this when setting long link
478 .Fl O Ns Cm style Ns = Ns Ar really/long/link .
484 output modes don't render the
486 font size escape documented in
491 Nesting elements within next-line element scopes of
501 and cause them to forget the formatting of the prior next-line scope.
507 should italicise all subsequent text if a line argument is not provided.
508 This behaviour is not implemented.
511 control character is an alias for the standard macro control character
512 and does not emit a line-break as stipulated in GNU troff.