troff2html: a troff to HTML
translator (version
1.2)
Jim Briggs
Department of Computer Science,
University of York
1. Introduction
troff2html is a translator for converting troff documents written using the ms macros (or extensions thereof) into HTML, for display on the World Wide Web.
It works by using nroff to produce a textual form of the normally typeset output of troff that includes HTML elements necessary to the format. Since it uses nroff, it is possi- ble for the user to extend the set of macros that are imple- mented and to use pre-processors such as tbl and refer.
2. Macros implemented
The following macros are implemented by troff2html:
2.1. Titles, etc.
lowing it is also used as a <H1> heading at the start of the document.
2.2. Paragraph macros
others map on to the HTML <P> construct.
2.3. Emphasis macros
<B> and <I> elements. .BI maps on to <STRONG> and therefore (depending on the browser) may appear the same as .B. The implementation of .R attempts to restore the normal font but may fail in cases of complicated nesting of these calls.
-2-
2.4. Other style macros
in HTML - their argument will appear in normal style.
2.5. Heading macros
since <H1> is used for titles. Section numbering for .NH is done by the troff2html macros.
2.6. Indented sections
Nesting is achieved by means of the <DL> construct which appears nested on most browsers.
2.7. Block quotations
This feature is implemented using HTML’s <BLOCKQUOTE>.
2.8. Tables, pictures, equations and display blocks