Tue, 19 Dec 2006

Writing man pages

On a Debian system, install the following using apt-get:

    asciidoc
    xmlto

Write your man page using asciidoc.  The asciidoc homepage can be found at:

    http://www.methods.co.nz/asciidoc/

where you can also find a user manual which will show examples
on usage.

When writing your man page, start by usng the ascii.1.txt page in 
/usr/share/doc/asciidoc as an example.  Copy this file to your
working area and edit it appropriately.  Once your page is written, 
run the following command:

    asciidoc -v --doctype=manpage --backend=docbook  photon.1.txt

This produces a photon.1.xml file.  Next run this command:

    xmlto man photon.1.xml

This produces a photon.1 man page.

Check photon.1 for small corrections.  It seems to add in extra .sp tags.

Preview your new man page by running this command:

    man ./photon.1

Posted at: 09:10 | category: /dev | Comments ()