]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/troff2html
audio(1): replace references to juke(7) and playlistfs(7) with zuke(1) (thanks unobe)
[plan9front.git] / sys / man / 1 / troff2html
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
29 .IR httpd (8)),
30 which converts
31 .IR man (1)
32 pages into HTML
33 and depends on a specially annotated set of
34 .IR man (6)
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 .IR 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 .IR ms2html (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 (6)
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 SOURCE
86 .B /sys/src/cmd/troff2html
87 .SH SEE ALSO
88 .IR troff (1),
89 .IR ms2html (1),
90 .B man2html
91 in
92 .IR httpd (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.