% cp /usr/share/misc/mdoc.templateDo not start afresh or by copying another manual unless you know exactly what you're doing! If the template doesn't exist, bug your administrator.
If your manual falls into multiple categories, choose the most widely-used or, better, re-consider the topic of your manual to be more specific. You can list all manuals per section by invoking apropos(1), then provide the -s flag to man(1) to see the specific section manual (section 1, in this example):
Section Description 1 operator utilities 2 system calls 3, 3p, 3f programming libraries (C, Perl, Fortran) 5 file and wire protocol formats 6 games 7 tutorials, documents and papers 8 administrator utilities 9 in-kernel routines
% apropos myname myname (1) - utility description myname (3) - library description % man -s 1 myname
% apropos mynameManual files are named myname.mysection, such as manuals.7 for this document. Rename the template file:
% mv mdoc.template myname.mysection
% mandoc -Tlint -Wall -fstrict name.1The quick-fix feature of vim(1) is useful for checking over many manuals:
% mandoc -Wall -fstrict -Tlint -fign-errors \ ./path/to/manuals/* 2>&1 > /tmp/mandoc.errs % vim -q /tmp/mandoc.errsYou may spell-check your work as follows:
% deroff name.1 | spellIf ispell(1) is installed, it has a special mode for manuals:
% ispell -n name.1Use cvs(1) or rcs(1) to version-control your work. If you wish the last check-in to effect your document's date, use the following RCS tag for the date macro:
.Dd $Mdocdate: December 25 2014 $
% mandoc -Wall name.1 2>&1 | less % groff -mandoc name.1 2>&1 | less
.SUFFIXES: .1 .in .in.1: mandoc -Wall,error -Tlint $< cp -f $< $@