Date: Fri, 15 Dec 1995 10:16:48 -0600 From: "Eric L. Hernes" <erich@lodgenet.com> To: Julian Elischer <julian@jhome.DIALix.COM> Cc: doc@freebsd.org Subject: Re: Did the troff to HTML c (fwd) Message-ID: <199512151616.KAA08659@jake.lodgenet.com> In-Reply-To: Your message of "Fri, 15 Dec 1995 13:08:42 %2B0800." <199512150508.NAA02461@jhome.DIALix.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
I've got perl script that I hacked out of plexus that does a pretty fair job of translating man pages to html on the fly. It even cross references #include files from sections 2 and 3. I'm using it to serve man pages for FreeBSD, linux, SCO, perl, tcl, and X11. Its pretty ugly right now, but it is functional. If anyone is interested, I can send a copy. eric. Julian Elischer writes: >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 ----- -- erich@lodgenet.com erich@rrnet.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512151616.KAA08659>