Re: Man pages server code, anyone?

Rik Harris <>
Message-id: <>
To: (Tim Berners-Lee)
Subject: Re: Man pages server code, anyone? 
In-reply-to: Your message of "28 Sep 92 13:40:33 +0100."
             <9209281240.AA04048@ > 
Date: Fri, 23 Oct 92 20:51:06 -1000
From: Rik Harris <>
X-Mts: smtp
Almost a month ago, Tim wrote:
> I know I heard of someone with a filter for unix man page to HTML,
> but I can't find it.  Does anyone on this list write one?

OK, I finally have a reasonably nice-looking man converter.  It does
the following things:

* puts section headings in <H2> </H2>'s.
* formats paragraphs with <P>.
* does some special characters.
* hypertext links for references to other manual pages.
* some <HP?> highlighting.

Current problems:

* it's not lightning fast.
* doesn't handle tbl correctly yet.
* it would be nice to put some things in a <DL> type list.
* many of the special characters missing.
* it does some strange spacing sometimes.

The filter is in a number of parts.  The first part is written in perl,
and parses the man page names and gets a list of filenames, which it
pipes to groff.  I have built a special groff filter in perl for the
second part.  This filter takes the groff device-independent intermediate
output, and converts it to HTML.

The code's not too bad, but could do with a bit of cleaning-up,
particularly the tbl handling.  You can play with the filter by connecting

where MANPAGE can just be a name, like 'cat', or it can be a name and
section, like 'cos(3m)'.

Please tell me if you notice anything strange, and I will attempt to
fix it.  I'll give the code to people if they really want it, but as I said
before, I hope to clean it up a little before I release it more
generally.  To run the code, you need groff and perl and you need to be
able to install new drivers for groff (I think there's an option for
groff to look in a different directory for drivers).

This is part of our local help/documentation system, which will
eventually be complete, changing documentation for our computer
systems.  I essentially wanted to be able to direct people to the man
pages when necessary, and I thought it pointless to have man pages if
you couldn't just click on the "See Also"'s  :-)

Have fun, and let me know what you think.

Rik Harris -         || Systems Programmer
+61 3 571-2895 (AH & ans.mach) +61 3 573-2679 (BH) || and Administrator
Faculty of Computing and Information Technology,   || Vic. Institute of
Caulfield Campus, Monash University, Australia     || Forensic Pathology