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 .MR 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
29 .IR httpd (8)),
30 which converts
31 .MR man (1)
32 pages into HTML
33 and depends on a specially annotated set of
34 .MR man (7)
35 macros, invoked by
36 .B troff
37 .BR -manhtml .
38 .PP
39 .B Troff
40 output lines beginning
41 .IP
42 .EX
43 x X html \f1...
44 .EE
45 .LP
46 which are introduced by placing
47 .B \eX'html\ \f1...\fP'
48 in the
49 .IR input ,
50 cause the rest of the line to be interpolated into the HTML produced.
51 Several such lines are recognized specially by
52 .IR troff2html .
53 The most important are the pair
54 .IP
55 .EX
56 x X html manref start cp 1
57 x X html manref end cp 1
58 .EE
59 .PP
60 which are used to create HTML hyperlinks around text of the form
61 .MR cp (1)
62 pointing to
63 .BR /magic/man2html/1/cp .
64 .PP
65 .I Troff2html
66 is new and experimental; in time, it may improve and subsume
67 Plan 9's
68 .IR ms2html (1).
69 On the one hand, because it uses the input,
70 .B ms2html
71 can handle
72 .MR pic (1) ,
73 .MR eqn (1) ,
74 etc., which
75 .I troff2html
76 does not handle at all; on the other hand,
77 .B ms2html
78 understands only
79 .MR ms (7)
80 documents and is easily confused by complex
81 .B troff
82 constructions.
83 .I Troff2html
84 has the reverse properties: it does not handle the preprocessors but its output
85 is reliable and (modulo helper annotations) is independent of macro package.
86 .SH SEE ALSO
87 .MR troff (1) ,
88 Plan 9's
89 .IR ms2html (1),
90 .I man2html
91 in
92 Plan 9's
93 .IR httpd (8).
94 .SH BUGS
95 .B Troff
96 and HTML have different models, and they don't mesh well in all cases.
97 .BR Troff 's
98 indented paragraphs are not well served in HTML, and the output of
99 .I troff2html
100 shows this.