<s>
mandoc	B-Application
(	O
historically	O
called	O
mdocml	B-Application
)	O
is	O
a	O
utility	O
used	O
for	O
formatting	O
man	B-Protocol
pages	I-Protocol
in	O
BSD	B-Operating_System
Operating	I-Operating_System
Systems	I-Operating_System
(	O
e.g.	O
</s>
<s>
NetBSD	B-Device
)	O
,	O
specifically	O
those	O
written	O
in	O
the	O
mdoc	O
and	O
man	B-Protocol
macro	O
languages	O
.	O
</s>
<s>
Unlike	O
the	O
groff	B-Application
and	O
older	O
troff	B-Language
and	O
nroff	B-Device
tools	O
that	O
are	O
predominantly	O
used	O
for	O
this	O
purpose	O
by	O
tools	O
such	O
as	O
,	O
mandoc	B-Application
focuses	O
specifically	O
on	O
manuals	O
and	O
is	O
not	O
suitable	O
for	O
general-purpose	O
type-setting	O
.	O
</s>
<s>
is	O
mainly	O
used	O
to	O
format	O
the	O
mdoc	O
manuals	O
used	O
in	O
the	O
BSD	B-Operating_System
Operating	I-Operating_System
Systems	I-Operating_System
,	O
but	O
it	O
also	O
implements	O
most	O
of	O
the	O
man	B-Protocol
macros	O
used	O
in	O
Linux	B-Application
distributions	O
,	O
as	O
well	O
as	O
a	O
subset	O
of	O
roff	O
commands	O
occasionally	O
intermixed	O
with	O
the	O
man	B-Protocol
macros	O
.	O
</s>
<s>
mandoc	B-Application
has	O
built-in	O
support	O
for	O
the	O
troff	B-Language
soelim	O
(	O
inclusion	O
)	O
preprocessor	O
and	O
partial	O
built-in	O
support	O
for	O
tbl	B-Application
and	O
eqn	B-Application
.	O
</s>
<s>
It	O
can	O
also	O
use	O
the	O
semantic	O
information	O
in	O
mdoc	O
manuals	O
to	O
implement	O
semantic	O
search	O
,	O
which	O
before	O
version	O
1.4.1	O
,	O
relied	O
on	O
sqlite	B-Language
.	O
</s>
<s>
Development	O
began	O
in	O
November	O
2008	O
specifically	O
to	O
produce	O
CSS-enabled	O
HTML	B-Language
forms	O
of	O
manuals	O
in	O
response	O
to	O
the	O
limitations	O
of	O
groff	B-Application
.	O
</s>
<s>
mandoc	B-Application
gained	O
initial	O
text-mode	O
output	O
in	O
February	O
2009	O
.	O
</s>
<s>
In	O
summer	O
of	O
2010	O
,	O
mandoc	B-Application
was	O
the	O
subject	O
of	O
a	O
NetBSD-mentored	O
Google	B-Application
Summer	I-Application
of	I-Application
Code	I-Application
project	O
for	O
producing	O
PostScript	B-Language
and	O
PDF	B-Application
output	O
alongside	O
the	O
existing	O
text	O
,	O
HTML	B-Language
,	O
and	O
XHTML	B-Language
outputs	O
.	O
</s>
<s>
This	O
work	O
was	O
completed	O
in	O
August	O
2010	O
.	O
mandoc	B-Application
became	O
the	O
default	O
formatter	O
of	O
manuals	O
for	O
OpenBSD	B-Operating_System
4.8	O
,	O
released	O
in	O
November	O
2010	O
.	O
</s>
<s>
It	O
later	O
became	O
the	O
default	O
formatter	O
in	O
NetBSD	B-Device
,	O
FreeBSD	B-Operating_System
,	O
illumos	B-Application
,	O
Void	O
Linux	B-Application
,	O
Alpine	O
Linux	B-Application
and	O
macOS	B-Application
,	O
and	O
is	O
also	O
included	O
in	O
DragonFlyBSD	B-Application
,	O
MINIX	B-Application
3	I-Application
,	O
Debian	O
,	O
Ubuntu	B-Operating_System
,	O
Gentoo	B-Application
,	O
and	O
Fedora	O
.	O
</s>
<s>
The	O
following	O
demonstrates	O
running	O
mandoc	B-Application
on	O
its	O
own	O
.	O
</s>
<s>
Usually	O
,	O
it	O
would	O
be	O
called	O
via	O
the	O
man	B-Protocol
utility	O
.	O
</s>
<s>
In	O
this	O
example	O
,	O
foo.1	O
is	O
the	O
name	O
of	O
an	O
mdoc	O
UNIX	B-Protocol
manual	I-Protocol
.	O
</s>
<s>
mandoc	B-Application
will	O
automatically	O
detect	O
the	O
encoding	O
.	O
</s>
<s>
The	O
included	O
apropos	B-Device
implementation	O
can	O
use	O
semantic	O
information	O
in	O
search	O
:	O
</s>
<s>
mandoc	B-Application
supports	O
HTML	B-Language
5	O
,	O
PostScript	B-Language
,	O
and	O
PDF	B-Application
output	O
via	O
the	O
parameter	O
.	O
</s>
<s>
man.cgi	O
is	O
a	O
CGI	B-Language
program	O
designed	O
to	O
display	O
manual	B-Protocol
pages	I-Protocol
on	O
the	O
web	O
.	O
</s>
<s>
OpenBSD	B-Operating_System
uses	O
it	O
to	O
format	O
all	O
its	O
manual	B-Protocol
pages	I-Protocol
.	O
</s>
