HOME

TheInfoList



OR:

mandoc (historically called mdocml) is a utility used for formatting
man pages A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and e ...
in BSD Operating Systems (e.g.
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is ava ...
), specifically those written in the ''mdoc'' and ''man'' macro languages. Unlike the groff and older
troff troff (), short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff. While nroff was inte ...
and
nroff nroff (short for "new roff") is a text-formatting program on Unix and Unix-like operating systems. It produces output suitable for simple fixed-width printers and terminal windows. It is an integral part of the Unix help system, being used ...
tools that are predominantly used for this purpose by tools such as , mandoc focuses specifically on manuals and is not suitable for general-purpose
type-setting Typesetting is the composition of text by means of arranging physical ''type'' (or ''sort'') in mechanical systems or ''glyphs'' in digital systems representing ''characters'' (letters and other symbols).Dictionary.com Unabridged. Random Ho ...
. is mainly used to format the ''mdoc'' manuals used in the BSD Operating Systems, but it also implements most of the ''man'' macros used in
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which in ...
distributions, as well as a subset of roff commands occasionally intermixed with the ''man'' macros. It does not support other macro sets such as ''mm'' and ''ms'', or any typesetting features like hyphenation, fonts and alignment. Simple styling such as bold and italics are supported, but italicized text is replaced by underlined text on the terminal. 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 Semantic search denotes search with meaning, as distinguished from lexical search where the search engine looks for literal matches of the query words or variants of them, without understanding the overall meaning of the query. Semantic search seek ...
, which before version 1.4.1, relied on
sqlite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most ...
.


History

Development began in November 2008 specifically to produce
CSS Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technolo ...
-enabled
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript ...
forms of manuals in response to the limitations of groff. mandoc gained initial text-mode output in February 2009. It was then showcased at AsiaBSDCon-2009. In summer of 2010, mandoc was the subject of a
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is ava ...
-mentored
Google Summer of Code The Google Summer of Code, often abbreviated to GSoC, is an international annual program in which Google awards stipends to contributors who successfully complete a free and open-source software coding project during the summer. , the program is ...
project for producing
PostScript PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Doug B ...
and
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems ...
output alongside the existing text, HTML, and
XHTML Extensible HyperText Markup Language (XHTML) is part of the family of XML markup languages. It mirrors or extends versions of the widely used HyperText Markup Language (HTML), the language in which Web pages are formulated. While HTML, prior ...
outputs. This work was completed in August 2010. mandoc became the default formatter of manuals for
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project emph ...
4.8, released in November 2010. It later became the default formatter in
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is ava ...
,
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular op ...
,
illumos Illumos (stylized as illumos) is a partly free and open-source Unix operating system. It is based on OpenSolaris, which was based on System V Release 4 (SVR4) and the Berkeley Software Distribution (BSD). Illumos comprises a kernel, device ...
,
Void Linux Void Linux is an independent Linux distribution that uses the X Binary Package System (XBPS) package manager, which was designed and implemented from scratch, and the runit init system. Excluding binary kernel blobs, a base install is composed en ...
,
Alpine Linux Alpine Linux is a Linux distribution designed to be small, simple and secure. Alpine Linux uses musl, BusyBox and OpenRC instead of the more commonly used glibc, GNU Core Utilities and systemd respectively.
and
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lap ...
, and is also included in
DragonFlyBSD DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in Ju ...
,
MINIX 3 Minix 3 is a small, Unix-like operating system. It is published under a BSD-3-Clause license and is a successor project to the earlier versions, Minix 1 and 2. The project's main goal is for the system to be fault-tolerant by detecting and rep ...
,
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of Deb ...
,
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All the ...
, Gentoo, and
Fedora A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
. Its advantages were stated as high speed, license, and clean reimplementation.


Sample usage

The following demonstrates running mandoc on its own. Usually, it would be called via the
man A man is an adult male human. Prior to adulthood, a male human is referred to as a boy (a male child or adolescent). Like most other male mammals, a man's genome usually inherits an X chromosome from the mother and a Y chromo ...
utility. In this example, foo.1 is the name of an ''mdoc'' UNIX manual. # 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 UTF-8 is a variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit''. UTF-8 is capable of e ...
. mandoc will automatically detect the encoding. # Page wide-character manual to the terminal. $ mandoc -l foo.jp.1 The included apropos implementation can use semantic information in search: # 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 parameter. * man.cgi is a CGI program designed to display manual pages on the web.
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project emph ...
uses it to format all its manual pages.


References


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 {{OpenBSD BSD software OpenBSD software using the ISC license