Blob


1 .TH TROFF2HTML 1
2 .SH NAME
3 troff2html \- convert troff output into HTML
4 .SH SYNOPSIS
5 .B troff2html
6 [
7 .B -t
8 .I title
9 ] [
10 .I file
11 \ ...
12 ]
13 .SH DESCRIPTION
14 .I Troff2html
15 reads the
16 .IR troff (1)
17 output in the named
18 .IR files ,
19 default standard input,
20 and converts them into HTML.
21 .PP
22 .I Troff2html
23 does a tolerable job with straight
24 .B troff
25 output, but it is helped by annotations, described below.
26 Its main use is for
27 .B man2html
28 (see Plan 9's \fIhttpd\fR(8)),
29 which converts
30 .IR man (1)
31 pages into HTML
32 and depends on a specially annotated set of
33 .IR man (7)
34 macros, invoked by
35 .B troff
36 .BR -manhtml .
37 .PP
38 .B Troff
39 output lines beginning
40 .IP
41 .EX
42 x X html \f1...
43 .EE
44 .LP
45 which are introduced by placing
46 .B \eX'html\ \f1...\fP'
47 in the
48 .IR input ,
49 cause the rest of the line to be interpolated into the HTML produced.
50 Several such lines are recognized specially by
51 .IR troff2html .
52 The most important are the pair
53 .IP
54 .EX
55 x X html manref start cp 1
56 x X html manref end cp 1
57 .EE
58 .PP
59 which are used to create HTML hyperlinks around text of the form
60 .IR cp (1)
61 pointing to
62 .BR /magic/man2html/1/cp .
63 .PP
64 .I Troff2html
65 is new and experimental; in time, it may improve and subsume
66 Plan 9's
67 \fIms2html\fR(1).
68 On the one hand, because it uses the input,
69 .B ms2html
70 can handle
71 .IR pic (1),
72 .IR eqn (1),
73 etc., which
74 .I troff2html
75 does not handle at all; on the other hand,
76 .B ms2html
77 understands only
78 .IR ms (7)
79 documents and is easily confused by complex
80 .B troff
81 constructions.
82 .I Troff2html
83 has the reverse properties: it does not handle the preprocessors but its output
84 is reliable and (modulo helper annotations) is independent of macro package.
85 .SH SEE ALSO
86 .IR troff (1),
87 Plan 9's
88 \fIms2html\fR(1),
89 .I man2html
90 in
91 Plan 9's
92 \fIhttpd\fR(8).
93 .SH BUGS
94 .B Troff
95 and HTML have different models, and they don't mesh well in all cases.
96 .BR Troff 's
97 indented paragraphs are not well served in HTML, and the output of
98 .I troff2html
99 shows this.