Layout

An mdoc document body is divided into sections. The names and ordering of these sections is dictated by convention extending to the Version 1 AT&T UNIX Programmer's Manual.

These conventional sections haven't changed much over the years, although more sections have been added and several have changed with evolving UNIX operating system conventions. The full set of modern sections, and their order, is as follows.

NAME
Name of all documented components and a collective description.
SYNOPSIS
Calling syntax of the components.
DESCRIPTION
Description of all components. This constitutes the bulk of the manual.
IMPLEMENTATION NOTES
Specific notes on the implementation of a generic (e.g., standardised) component.
RETURN VALUES
Return values, if the components are functions.
ENVIRONMENT
Environmental variables affecting the components' operation.
FILES
Files affecting the components' operation.
EXIT STATUS
Exit status, if the components are commands.
EXAMPLES
Brief examples of invocation.
DIAGNOSIS
Error conditions, if a command or device driver.
ERRORS
Error conditions, if a function or library.
SEE ALSO
Links to other relevant manuals or references.
STANDARDS
Implemented or referenced standards.
HISTORY
A brief history of the components.
AUTHORS
The authors of the components.
CAVEATS
Caveats regarding the components' operation.
BUGS
Known bugs in the components.
SECURITY CONSIDERATIONS
Security precautions beyond the scope of the components.

Only the NAME and DESCRIPTION sections are required in the document body, although a SYNOPSIS should appear for most manuals as well.

Other sections may be necessary depending on the category. For example, RETURN VALUES is found for most category 3 and 2 manuals; while EXIT STATUS is found for most category 1, 6, and 8 manuals.

Last edited by $Author: kristaps $ on $Date: 2011/11/04 01:06:28 $. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.