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