Should I use mdoc for user programs?

Polytropon freebsd at
Thu Oct 12 09:17:33 UTC 2017

On Thu, 12 Oct 2017 11:02:49 +0200, Sijmen J. Mulder wrote:
> Is it considered bad form to use mdoc, rather than some other man 
> format, for documenting non-system programs?

No, many programs from the ports collection provide a manpage
in the standard format (for example "man opera" which is far
from being a system program).

> I noticed that the required .Os macro (man 7 mdoc) outputs "FreeBSD 
> General Commands Manual" which does not seem appropriate.

If I remember correctly, you can easily redefine them:

.Dd <date>
.Ot <name> <section> "<title of manual page>"
.Os <OS>

This will generate the following layout:

<name>(<section>)        <title of manual page>        <name>(<section>)

... your manual page text here ...

<OS>                             <date>                             <OS>

If you simply use .Os, the page title will be derived from the
2nd parameter to .Dt, i. e., the section number.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list