Mandoc
mandoc (historically called mdocml) is a utility used for formatting man pages in BSD Operating Systems (e.g. NetBSD), specifically those written in the mdoc and man macro languages. Unlike the groff and older troff and nroff tools that are predominantly used for this purpose by tools such as
mandoc has built-in support for the troff soelim (inclusion) preprocessor and partial built-in support for tbl and eqn. It has strong support for UTF-8 output. It can also use the semantic information in mdoc manuals to implement semantic search, which before version 1.4.1, relied on sqlite.[1]: 1.4.1 HistoryDevelopment began in November 2008 specifically to produce CSS-enabled HTML forms of manuals in response to the limitations of groff. mandoc gained initial text-mode output in February 2009.[5] It was then showcased at AsiaBSDCon-2009.[6][7][8] In summer of 2010, mandoc was the subject of a NetBSD-mentored Google Summer of Code project[9] for producing PostScript and PDF output alongside the existing text, HTML, and XHTML outputs. This work was completed in August 2010.[10] mandoc became the default formatter of manuals for OpenBSD 4.8, released in November 2010.[11][12] It later became the default formatter in NetBSD, FreeBSD, illumos, Void Linux, Alpine Linux and macOS, and is also included in DragonFlyBSD, MINIX 3, Debian, Ubuntu, Gentoo, and Fedora.[13] Its advantages were stated as high speed,[14] license, and clean reimplementation. Sample usageThe following demonstrates running $ # Page manual to the terminal.
$ mandoc -l foo.1
$ # HTML output with a style-sheet.
$ mandoc -Thtml -Ostyle=style.css >foo.1.html
Multibyte (localised) manuals may also be rendered without preprocessing. In this example, $ # Page wide-character manual to the terminal.
$ mandoc -l foo.jp.1
The included apropos implementation can use semantic information in search:[16] $ # Search for all functions starting with 'str' having return type size_t:
$ apropos -s 3 Ft=size_t -a Nm~^str
Other features
References
External links
|