mandoc
Initial release | November 2008 |
---|---|
Stable release | 1.14.6
/ September 23, 2021[1] |
Repository | |
Written in | C |
Type | Typesetting |
License | ISC license |
Website | mandoc |
mandoc (historically called mdocml) is a utility used for formatting
type-setting
.
mandoc
is mainly used to format the mdoc manuals used in the
roff commands occasionally intermixed with the man macros.[2][1]: 1.14.5 It does not support other macro sets such as mm and ms, or any typesetting features like hyphenation, fonts and alignment.[2]: compatibility Simple styling such as bold and italics are supported, but italicized text is replaced by underlined text on the terminal.[3][4]
mandoc has built-in support for the troff soelim (inclusion) preprocessor and partial built-in support for
sqlite.[1]
: 1.4.1
History
Development began in November 2008 specifically to produce
license, and clean reimplementation.Sample usage
The following demonstrates running mandoc
on its own. Usually, it would be called via the man utility. In this example, foo.1
is the name of an mdoc UNIX manual.[15]
# 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, foo.jp.1
is a Japanese manual encoded in UTF-8. mandoc will automatically detect the encoding.[15]
# 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
mandoc
supports HTML 5, PostScript, and PDF output via the-T
parameter.[15]man.cgi
is a CGI program designed to display manual pages on the web. OpenBSD uses it to format all its manual pages.[17]
References
- ^ a b c "Release notes". September 23, 2021.
- ^ a b OpenBSD Miscellaneous Information Manual –
- ^ "Italics and colour in manual pages on a nosh user-space virtual terminal". jdebp.eu.
- ^ FreeBSD General Commands Manual. "Font styles are applied by using back-spaced encoding..." –
- ^ "Source history". Mdocml.bsd.lv. Retrieved 2010-12-18.
- ^ "AsiaBSDCon 2009: Deprecating groff for BSD manual display". 2009.asiabsdcon.org. 2009-03-15. Retrieved 2010-12-18.
- ^ "Deprecating groff for BSD manual display" (PDF). Retrieved 2010-12-18.
- ^ "Video of AsiaBSDCon presentation". Youtube.com. Retrieved 2010-12-18.
- ^ "Google Summer of Code: mandoc_ps". Netbsd-soc.sourceforge.net. Retrieved 2010-12-18.
- ^ "NetBSD Blog". Blog.netbsd.org. 2010-08-11. Retrieved 2010-12-18.
- ^ "OpenBSD 4.8". Openbsd.org. 2010-11-01. Retrieved 2010-12-18.
- ^ "groff deleted from tree".
- ^ "Availability of the mandoc toolset". Mdocml.bsd.lv.
- ^ Unangst, Ted. "mandoc speed benchmarks".
- ^ a b c OpenBSD General Commands Manual –
- ^ OpenBSD General Commands Manual –
- ^ OpenBSD System Manager's Manual –
External links
- The mandoc UNIX manpage compiler toolset
- OpenBSD online manpages, generated by mandoc's man.cgi program
- Undeadly article on mandoc
- Google Summer of Code mandoc_ps project site - work on PostScript support
- Freecode page for mandoc - used until 1.12.2