Pete's Linux Advent Calendar 2007
The 10th day
Manpages
Now you have a collection of selfmade scripts. But without documentation
it wouldn't be complete. So here is a quick introduction on manpages.
The easiest way to write them is using pod2man. You
don't want to write nroff. Here is an example pod file for the up
script, called up.pod:
=head1 NAME
up - position the cursor at first line
=head1 SYNOPSIS
B<up>
=head1 DESCRIPTION
Up positions the cursor at the first line of your terminal
=head1 OPTIONS
There are no options to this command.
=head1 BUGS
B<up> ignores any arguments given
=head1 SEE ALSO
down(1)
Have a look at the pod2man(1) manpage on more advanced
usage and the structure of manpages. Now type:
pod2man up.pod > up.1
to create the manpage. To view it type:
man -l up.1
if it looks good you only have to copy it to your manpath. Create
a directory ~/man/man1 and copy the file up.1
there. Now set you environment variable MANPATH to :$HOME/man.
Now you can just view the manpage by calling man up.