_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

mandocoptions

mandoc outputs to stdout, it can be redirected to a file.

mandoc -T html -O includes=[PATH]/%I,man=[PATH]/%N[%S].html,style=[PATH_TO_CSS] [INPUT_MDOC] > [OUTPUT_HTML]

Translate .In macro to PATH/[INCLUDE_NAME]:

includes=[PATH]/%I
Eg.:
.In somename
Translates to PATH/somename.

man=[PATH]/%N[%S]
  • N is replaced by the name, and S for the section eg.: ssh.1.
  • a fallback format can be given, if the corresponding file does not exist in the current directory, it will use the second format:
man=[PATH]/%N[%S];[PATH|URL]/%N[%S]

man=/%N.html;https://man.openbsd.org/%N.%S
.Xr roff oh
will be translated to ohazot.com/roff.html
.Xr roff 7
will be translated to https://man.openbsd.org/roff.7

Up to OpenBSD 7.7 the output displayed the footer as:

Operating_System Date Operating_System
mdoc macros:
Os Dd Os
As of 7.8 the footer is displayed as:
Operating_System Date Document_Title(Document_Section)
mdoc macros:
Os Dd Dt

(back to top)

Tables should be reviewed when exporting to markdown as they are not converted to markdown tables but code.

This has been tested on OpenBSD 7.8, this is still occurs.

.It Sy header1 Ta header2 .It cell1 Ta cell2 .El

	**header1** **header2**
	cell1      cell2
	row2       row2 - cell2

Markdown does not have tables by default, however, many markdown implementations will use the following syntax:

|header1|header2|
|-------|-------|
|cell1|cell2  |
|row2|row2 - cell2|

(back to top)

- Review this document on OpenBSD 7.8 release.
- Translate to Spanish.

(back to top)

documentation, openbsd, roff, mdoc, css, html
OpenBSD manpages: mandoc(1), mdoc(7), roff(7)
links
- The mandoc UNIX manpage compiler toolset
- Markdown syntax

(back to top)

2026-06-03 : Clarified markdown tables.
2025-10-29 : show table conversion to markdown.
2025-10-03 : Created.

(back to top)

ohazot | about | ohazot.com <admin@ohazot.com>

This document applies to: OpenBSD 7.7 linux| 2026-03-24