Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 1995 13:08:42 +0800 (WST)
From:      Julian Elischer <julian@jhome.DIALix.COM>
To:        doc@freebsd.org
Subject:   Re: Did the troff to HTML c (fwd)
Message-ID:  <199512150508.NAA02461@jhome.DIALix.COM>

next in thread | raw e-mail | index | archive | help
maybe we can use this to keep our man-pages on the www page up-to-date.

--forwrded message..--



The troff to html translation is marginal.  I was able to translate
the first page of an ms document.  I could translate the first page of
a man document as well.  Another document translated completely.

The quality of the translation is mediocre.  Paragraphs are run
together.  Try

	file://~/.html/cvs.html

to see cvs(5) man page after the translation.  This was the best
transation I received.

The program is called troff2html.  It is in /tools unsupported/bin.
It is a perl program.  The complete source is in
/net/opshub/export/unsupported/src/troff2html.  I'll let someone else
work further with the translation, if anyone desires.  Try running
with the "-man" or "-ms" macros.  Here is the README file.

A Troff to HTML Converter
=========================

I have used troff (and -ms macros) for many years and wanted
to be able to convert my source documents into html format.

I couldn't find a troff converter but did try a couple of
converters for the -ms macros.  I found that these often
translated things different to the way I wanted them handled
and that they had poor support for the troff features I
often use, such as source file includes and font changes.

Therefore I decided on a two-stage process:

troff2html
==========

This translates raw troff into html.  Troff escapes are
handled internally but troff requests are translated into
sequences of perl commands in a control file (troff.req). 
This control file is easily edited to change the behaviour
of requests or to add new ones, i.e.  those I haven't dealt
with. 

ms.pl
=====

This translates the -ms macros into html.  It maintains an
html state stack.  The -ms macros are represented as
sequences of perl commands in a control file (troff.ms).
Once again, this control file is easily edited.

mv.pl
=====

This translates the -mv macros into html (see control file
troff.mv).

man.pl
======

This translates the -man macros into html (see control file
troff.man).

And Finally
===========

The result of this is an extremely adaptable package. 
Additional macro packages, e.g. -me macros, are easily added
with their own control file.

Preprocessors, like refer, can be used with the troff source
because their output is recognised. 

Personal macros can also be added easily.

Where are they?
===============

A compressed tar archive of version 1.0 can be found at URL
http://web.dcs.bbk.ac.uk/~mick/html

Mick Farmer
-- 
Kevin Dalley
dalley@tfs.com

----- End of forwarded message from dalley@desrv.tfs.com -----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512150508.NAA02461>