GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STYLE.MDOC(5) FreeBSD File Formats Manual STYLE.MDOC(5)

style.mdocFreeBSD manual page style guide

This file specifies the preferred style for manual pages in the FreeBSD source tree.

  • Use literal formatting for examples and literal shell commands, e.g.:
    Then run
    .Ql make install clean .

    which renders as:

    Then run ‘make install clean’.

    The incorrect way would be to use macros like to stylize the command invocation:

    Then run
    .Ql Nm make Cm install Cm clean .

    which renders as:

    Then run ‘make install clean’.
  • The macro is the preferred macro for formatting literal inline fragments. Historically, Dq Li was the preferred way before the deprecation of .

Driver manuals in section four should have a HARDWARE section describing hardware known to work with the driver. This section is drawn verbatim into the Release Hardware Notes, therefore there are several things to note:

  • The introductory sentence should be in the form:
    The
    .Nm
    driver supports the following $device_class:

    Followed by the list of supported hardware.

    This defines what driver the subsection is referring to, and allows the reader to search through the Hardware Notes not only for the device models they have, but also for the device type they are looking to acquire.

  • The supported hardware should be listed as a bullet list, or if complexity requires, a column list. These two list types create very neat subsections with clean starting and stopping points.

  • Format the EXAMPLES section in the following way:
    .Bl -tag -width 0n
    .It Sy Example 1\&: Doing Something
    .Pp
    The following command does something.
    .Bd -literal -offset 2n
    .Ic # make -VLEGAL
    .Ed
    .It Sy Example 2\&: Doing Something Different
    .Pp
    The following command does something different.
    .Bd -literal -offset 2n
    .Ic # bectl list
    .Ed
    .Pp
    It is good to know this command.
    .El

    which renders as:

    The following command does something.

    # make -VLEGAL

    The following command does something different.

    # bectl list

    It is good to know this command.

  • The -width argument to the macro should match the length of the longest rendered item in the list, e.g.:
    .Bl -tag -width "-a address"
    .It Fl a Ar address
    Set the address.
    .It Fl v
    Print the version.
    .El

    In case the longest item is too long and hurts readability, the recommendation is to set the -width argument to ‘indent’, e.g.:

    .Bl -tag -width "indent"
    .It Cm build
    Build the port.
    .It Cm install
    Install the port.
    .It Fl install-missing-packages
    Install the missing packages.
    .El

  • Do not put whitespace between alternative parameters separated with a pipe (“|”), e.g.:
    .Cm compression Cm on Ns | Ns Cm off
    .Cm install Fl -all Ns | Ns Ar portname Ar ...

    which in the SYNOPSIS section is rendered as:

    compression on|off
    install --all|portname ...
  • Use Cm to stylize characters that are command modifiers (e.g., “,”, “@” or “=”). For example:
    .Sm off
    .Fl -meet Cm = Ar who Oo Cm , Ar who " " Ar "..." Oc Cm @ Ar where
    .Sm on

    which renders as:

    --meet=who[,who ...]@where

    instead of:

    .Sm off
    .Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where
    .Sm on

    which would render as:

    --meet=who[,who ...]@where

    It is important to realize that in the correct example, “,”, “@” and “=” are stylized with Cm. At the same time, the square brackets (“[]”) are not stylized as they do not belong to the syntax of the --meet flag.

  • Use the Dq (“”) macro for quoting. Use the (‘’) macro for quoting inside quotes. The use of the ("") macro is usually not necessary.

  • Use Va instead of for sysctl(8) variables like kdb.enter.panic.
  • Use the angle brackets (“<>”) macro for arguments () when they are mixed with similarly stylized macros like or Va, e.g.:
    .Va critical_filesystems_ Ns Aq Ar type

    which renders as:

    critical_filesystems_type

    instead of:

    .Va critical_filesystems_ Ns Ar type

    that would be rendered as:

    critical_filesystems_type

man(1), mandoc(1), mdoc(7), roff(7), style(9)

This manual page first appeared in FreeBSD 13.0.

Mateusz Piotrowski <0mp@FreeBSD.org>

December 21, 2024 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 5 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.