For what it's worth, I am not a fan of info pages. I prefer the good old Unix man pages and it is very simple to write them. You can simply open any man page in an editor, look at it's source and just copy it to suit your needs.
On most systems the man pages are found in a directory like /usr/share/man/{man1,man2,man3,man4,man5,man6,man7,man8}/
, or you can use the -w
option of the man
command to see the location of any man page and then open it. For example
$ man -w ls
/usr/share/man/man1/ls.1.gz
$ vim /usr/share/man/man1/ls.1.gz
You can see how it is written, and mimic it to write your own man page. In order for anyone to be able to read the man page written by you, the man page has to be installed in one of the directories where the man utility searches for man pages. On Linux, you can usually see this list of directories by running the manpath
command (on other systems it might be different and you will have to see the man page of the man
command itself). If you store your man pages in one of these directories then any one can read it by using the man
utility.
As per POSIX
the man
utility also respects the environment variable MANPATH
, so if you store your man page in a non-standard location, you can set the MANPATH variable, so that man
can look it up. Or you can also modify the /etc/man.conf
file to add your man page directory to the search path of man
.
Now, man pages use a macro language to do the mark up. Linux systems tend to use man(7)
macro syntax, for which you can see the manual here
There is another modern macro set for writing man pages, called mdoc(7)
, which is used extensively in the BSD family of operating systems. You can see its manual here