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

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

back to top

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 testted on OpenBSD 7.8, this is still occurs.

.Bl -column header1 header2
.It Sy header1 Ta header2
.It cell1 Ta cell2
.El

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

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

back to top

back to top

documentation , openbsd , roff , mdoc , css , html

- OpenBSD manpages: mandoc(1) , mdoc(7) , roff(7)

- Markdown syntax

back to top

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

OpenBSD 7.7 linux| Created:2025-10-03|Updated:2025-11-10|