groff 1.23.0 added .MR to its -man macro package. The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020." From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.
Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.
Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized. groff's .MR does not. This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
101 lines
1.9 KiB
Groff
101 lines
1.9 KiB
Groff
.TH TROFF2HTML 1
|
|
.SH NAME
|
|
troff2html \- convert troff output into HTML
|
|
.SH SYNOPSIS
|
|
.B troff2html
|
|
[
|
|
.B -t
|
|
.I title
|
|
] [
|
|
.I file
|
|
\ ...
|
|
]
|
|
.SH DESCRIPTION
|
|
.I Troff2html
|
|
reads the
|
|
.MR troff 1
|
|
output in the named
|
|
.IR files ,
|
|
default standard input,
|
|
and converts them into HTML.
|
|
.PP
|
|
.I Troff2html
|
|
does a tolerable job with straight
|
|
.B troff
|
|
output, but it is helped by annotations, described below.
|
|
Its main use is for
|
|
.B man2html
|
|
(see Plan 9's
|
|
.IR httpd (8)),
|
|
which converts
|
|
.MR man 1
|
|
pages into HTML
|
|
and depends on a specially annotated set of
|
|
.MR man 7
|
|
macros, invoked by
|
|
.B troff
|
|
.BR -manhtml .
|
|
.PP
|
|
.B Troff
|
|
output lines beginning
|
|
.IP
|
|
.EX
|
|
x X html \f1...
|
|
.EE
|
|
.LP
|
|
which are introduced by placing
|
|
.B \eX'html\ \f1...\fP'
|
|
in the
|
|
.IR input ,
|
|
cause the rest of the line to be interpolated into the HTML produced.
|
|
Several such lines are recognized specially by
|
|
.IR troff2html .
|
|
The most important are the pair
|
|
.IP
|
|
.EX
|
|
x X html manref start cp 1
|
|
x X html manref end cp 1
|
|
.EE
|
|
.PP
|
|
which are used to create HTML hyperlinks around text of the form
|
|
.MR cp 1
|
|
pointing to
|
|
.BR /magic/man2html/1/cp .
|
|
.PP
|
|
.I Troff2html
|
|
is new and experimental; in time, it may improve and subsume
|
|
Plan 9's
|
|
.IR ms2html (1).
|
|
On the one hand, because it uses the input,
|
|
.B ms2html
|
|
can handle
|
|
.MR pic 1 ,
|
|
.MR eqn 1 ,
|
|
etc., which
|
|
.I troff2html
|
|
does not handle at all; on the other hand,
|
|
.B ms2html
|
|
understands only
|
|
.MR ms 7
|
|
documents and is easily confused by complex
|
|
.B troff
|
|
constructions.
|
|
.I Troff2html
|
|
has the reverse properties: it does not handle the preprocessors but its output
|
|
is reliable and (modulo helper annotations) is independent of macro package.
|
|
.SH SEE ALSO
|
|
.MR troff 1 ,
|
|
Plan 9's
|
|
.IR ms2html (1),
|
|
.I man2html
|
|
in
|
|
Plan 9's
|
|
.IR httpd (8).
|
|
.SH BUGS
|
|
.B Troff
|
|
and HTML have different models, and they don't mesh well in all cases.
|
|
.BR Troff 's
|
|
indented paragraphs are not well served in HTML, and the output of
|
|
.I troff2html
|
|
shows this.
|