|MANDOC(1)||General Commands Manual||MANDOC(1)|
mandocutility formats UNIX manual pages for display.
The arguments are as follows:
fatal. The default is
allis an alias for
warning. See EXIT STATUS and DIAGNOSTICS for details.
The special option
mandoc to exit after parsing a file that causes
warnings or errors of at least the requested level. No formatted output
will be produced from that file. If both a level
stop are requested, they can be joined with
a comma, for example
mandocwill halt with the first failed parse.
mandocutility accepts mdoc(7) and man(7) input with
an, respectively. The mdoc(7) format is strongly recommended; man(7) should only be used for legacy manuals.
If multiple files are specified with
andoc, each has its
file-type determined this way. If multiple files are specified and
an is specified, then this
format is used exclusively.
mandocutility accepts the following
-Targuments, which correspond to output modes:
If multiple input files are specified, these will be processed by the corresponding filter in-order.
ascii, which is the default, is rendered in standard 7-bit ASCII documented in ascii(7).
Font styles are applied by using back-spaced encoding such that an underlined character ‘c’ is rendered as ‘_\[bs]c’, where ‘\[bs]’ is the back-space character number 8. Emboldened characters are rendered as ‘c\[bs]c’.
The special characters documented in mandoc_char(7) are rendered best-effort in an ASCII equivalent. If no equivalent is found, ‘?’ is used instead.
Output width is limited to 78 visible columns unless literal input lines exceed this limit.
-O arguments are
htmlconforms to HTML-4.01 strict.
The example.style.css file documents
style-sheet classes available for customising output. If a style-sheet is
not specified with
html defaults to simple
output readable in any graphical or text-based web browser.
Special characters are rendered in decimal-encoded UTF-8.
-O arguments are
styleargument will be ignored. This is useful when embedding manual content within existing documents.
locale. This option is not available on all systems: systems without locale support, or those whose internal representation is not natively UCS-4, will fall back to
ascii. See ASCII Output for font style specification and available command-line arguments.
If mdoc(7) is passed
as input, it is translated into
man(7). If the input format is
man(7), the input is copied to
the output, expanding any
requests. The parser is also run, and as usual, the
-W level controls which
DIAGNOSTICS are displayed before
copying the input to the output.
-Oarguments and defaults.
ps. Output pages default to letter sized and are rendered in the Times font family, 11-point. Margins are calculated as 1/9 the page length and width. Line-height is 1.4m.
Special characters are rendered as in ASCII Output.
-O arguments are
utf8to force a UTF-8 locale. See Locale Output for details and options.
xhtmlconforms to XHTML-1.0 strict.
See HTML Output for details; beyond generating XHTML tags instead of HTML tags, these output modes are identical.
mandocutility exits with one of the following values, controlled by the message level associated with the
mandocto exit at once, possibly in the middle of parsing or formatting a file.
Note that selecting
lint output mode implies
$ mandoc -Wall,stop mandoc.1 2>&1 | less
$ mandoc mandoc.1 mdoc.3 mdoc.7 | less
To produce HTML manuals with style.css as the style-sheet:
$ mandoc -Thtml -Ostyle=style.css mdoc.7 > mdoc.7.html
To check over a large set of manuals:
$ mandoc -Tlint `find /usr/src -name \*\.[1-9]`
To produce a series of PostScript manuals for A4 paper:
$ mandoc -Tps -Opaper=a4 mdoc.7 man.7 > manuals.ps
$ mandoc -Tman foo.mdoc > foo.man
where the fields have the following meanings:
Message levels have the following meanings:
mandocdoes not implement it yet. By discarding part of the input or inserting missing tokens, the parser is able to continue, and the error does not prevent generation of formatted output, but typically, preparing that output involves information loss, broken document structure or unintended formatting.
Messages of the
error levels are hidden unless their level, or a
lower level, is requested using a
-W option or
lint output mode.
mandoc utility may also print messages
related to invalid command line arguments or operating system errors, for
example when memory is exhausted or input files cannot be read. Such
messages do not carry the prefix described above.
mandoccompatibility with GNU troff. Each input and output format is separately noted.
asciiare synonyms, as are -filled and -ragged.
asciidoes not assert a prior vertical break, just as it doesn't with ‘Sh’.
asciihas no effect.
mandocutility was written by Kristaps Dzonsons, email@example.com.
xhtml, the maximum size of an element attribute is determined by
BUFSIZ, which is usually 1024 bytes. Be aware of this when setting long link formats such as
Nesting elements within next-line element scopes of
an, such as
‘br’ within an empty ‘B’, will confuse
xhtml and cause them to
forget the formatting of the prior next-line scope.
The ‘'’ control character is an alias for the standard macro control character and does not emit a line-break as stipulated in GNU troff.
|December 25, 2011||OpenBSD-5.1|