Creating your own man page
This is simply a little tutorial for fun. :) You will finally have your name up their with 'find', 'sed' and 'hey'!
The nroff command is an emulator and by giving the -man option, it outputs the file in a manual page style. This prints everything out, so it is best to catch the output and pipe it into 'more' like so:
nroff -man ~art_wolf/art_wolf.8 | more
It is the nroff syntax we will be looking at and how to make the output resemble a man page.
nroff has several settings and we will be using most of them to achive our look. Here are the main ones:
Request Cause Break Explanation
.B t no Text t is bold. Quote to imbed blanks. .I t no Text t is italic. Quote to imbed blanks. .TP x yes Set prevailing indent to 5. Begin indented paragraph with hanging tag given by first argument. Tag x is always placed on a separate line. .LP yes Same as .PP. .PP yes Begin paragraph. Set prevailing indent to 5. .RE yes End of relative indent. Set prevailing indent to amount of starting .RS. .RS yes Start relative indent, move left margin in distance 5. .SH t yes Subhead. Quote to imbed blanks. .SS t yes Subsection. Quote to imbed blanks. No indent for t. .TH n s c v d yes Begin page named n of chapter s; c is the chapter name; d is the date of the most recent change; v is version number. Sets prevailing indent and tabs to 5.
Read a sample man page here. Save this to your home directory and rename it 'username.8' and modify it to your hearts content :)
.TH USERNAME 1 This is part of a normal man page layout which prints USERNAME(1) at the corners of the man page.
.SH SECTION This sets a head section..surprise surprise.. used like this:
SYNOPSIS sample [options]
.SH SYNOPSIS sample [options]
.TP 5 This gives a break and is used between options to seperate them.
.B sample This sets everything on the line to bold. If there are spaces in the word everything must be enclosed with quotes.
A quick google and here are the main headings used in man pages - now it's time for you to try your own. :)