Debian Codegraph @

upstream/mageia-cauldron/man1/rman.1

raw
1 .TH PolyglotMan 1
2 .SH "NAME "
3 PolyglotMan, rman - reverse compile man pages from formatted
4 form to a number of source formats
5 .SH "SYNOPSIS "
6 rman [ \fIoptions \fR] [ \fIfile \fR]
7 .SH "DESCRIPTION "
8 Up-to-date instructions can be found at
9 http://polyglotman.sourceforge.net/rman.html
10
11 .PP
12 \fIPolyglotMan \fR takes man pages from most of the popular flavors
13 of UNIX and transforms them into any of a number of text source
14 formats. PolyglotMan was formerly known as RosettaMan. The name
15 of the binary is still called \fIrman \fR, for scripts that depend
16 on that name; mnemonically, just think "reverse man". Previously \fI
17 PolyglotMan \fR required pages to be formatted by nroff prior
18 to its processing. With version 3.0, it \fIprefers [tn]roff source \fR
19 and usually produces results that are better yet. And source
20 processing is the only way to translate tables. Source format
21 translation is not as mature as formatted, however, so try formatted
22 translation as a backup.
23 .PP
24 In parsing [tn]roff source, one could implement an arbitrarily
25 large subset of [tn]roff, which I did not and will not do, so
26 the results can be off. I did implement a significant subset
27 of those use in man pages, however, including tbl (but not eqn),
28 if tests, and general macro definitions, so usually the results
29 look great. If they don't, format the page with nroff before
30 sending it to PolyglotMan. If PolyglotMan doesn't recognize a
31 key macro used by a large class of pages, however, e-mail me
32 the source and a uuencoded nroff-formatted page and I'll see
33 what I can do. When running PolyglotMan with man page source
34 that includes or redirects to other [tn]roff source using the .so (source
35 or inclusion) macro, you should be in the parent directory of
36 the page, since pages are written with this assumption. For example,
37 if you are translating /usr/man/man1/ls.1, first cd into /usr/man.
38 .PP
39 \fIPolyglotMan \fR accepts man pages from: SunOS, Sun Solaris,
40 Hewlett-Packard HP-UX, AT&T System V, OSF/1 aka Digital UNIX,
41 DEC Ultrix, SGI IRIX, Linux, FreeBSD, SCO. Source processing
42 works for: SunOS, Sun Solaris, Hewlett-Packard HP-UX, AT&T System
43 V, OSF/1 aka Digital UNIX, DEC Ultrix. It can produce printable
44 ASCII-only (control characters stripped), section headers-only,
45 Tk, TkMan, [tn]roff (traditional man page source), SGML, HTML,
46 MIME, LaTeX, LaTeX2e, RTF, Perl 5 POD. A modular architecture
47 permits easy addition of additional output formats.
48 .PP
49 The latest version of PolyglotMan is available from \fI
50 http://polyglotman.sourceforge.net/ \fR.
51 .SH "OPTIONS "
52 The following options should not be used with any others and
53 exit PolyglotMan without processing any input.
54 .TP 15
55 -h|--help
56 Show list of command line options and exit.
57 .TP 15
58 -v|--version
59 Show version number and exit.
60 .PP
61 \fIYou should specify the filter first, as this sets a number
62 of parameters, and then specify other options.
63 .TP 15
64 -f|--filter <ASCII|roff|TkMan|Tk|Sections|HTML|SGML|MIME|LaTeX|LaTeX2e|RTF|POD>
65 Set the output filter. Defaults to ASCII.
66 .TP 15
67 -S|--source
68 PolyglotMan tries to automatically determine whether its input
69 is source or formatted; use this option to declare source input.
70 .TP 15
71 -F|--format|--formatted
72 PolyglotMan tries to automatically determine whether its input
73 is source or formatted; use this option to declare formatted
74 input.
75 .TP 15
76 -l|--title \fIprintf-string \fR
77 In HTML mode this sets the <TITLE> of the man pages, given the
78 same parameters as \fI-r \fR.
79 .TP 15
80 -r|--reference|--manref \fIprintf-string \fR
81 In HTML and SGML modes this sets the URL form by which to retrieve
82 other man pages. The string can use two supplied parameters:
83 the man page name and its section. (See the Examples section.)
84 If the string is null (as if set from a shell by "-r ''"), `-'
85 or `off', then man page references will not be HREFs, just set
86 in italics. If your printf supports XPG3 positions specifier,
87 this can be quite flexible.
88 .TP 15
89 -V|--volumes \fI<colon-separated list> \fR
90 Set the list of valid volumes to check against when looking for
91 cross-references to other man pages. Defaults to \fI1:2:3:4:5:6:7:8:9:o:l:n:p \fR(volume
92 names can be multicharacter). If an non-whitespace string in
93 the page is immediately followed by a left parenthesis, then
94 one of the valid volumes, and ends with optional other characters
95 and then a right parenthesis--then that string is reported as
96 a reference to another manual page. If this -V string starts
97 with an equals sign, then no optional characters are allowed
98 between the match to the list of valids and the right parenthesis. (This
99 option is needed for SCO UNIX.)
100 .PP
101 The following options apply only when formatted pages are given
102 as input. They do not apply or are always handled correctly with
103 the source.
104 .TP 15
105 -b|--subsections
106 Try to recognize subsection titles in addition to section titles.
107 This can cause problems on some UNIX flavors.
108 .TP 15
109 -K|--nobreak
110 Indicate manual pages don't have page breaks, so don't look for
111 footers and headers around them. (Older nroff -man macros always
112 put in page breaks, but lately some vendors have realized that
113 printout are made through troff, whereas nroff -man is used to
114 format pages for reading on screen, and so have eliminated page
115 breaks.) \fIPolyglotMan \fR usually gets this right even without
116 this flag.
117 .TP 15
118 -k|--keep
119 Keep headers and footers, as a canonical report at the end of
120 the page. changeleft
121 Move changebars, such as those found in the Tcl/Tk manual pages,
122 to the left. --> notaggressive
123 \fIDisable \fR aggressive man page parsing. Aggressive manual,
124 which is on by default, page parsing elides headers and footers,
125 identifies sections and more. -->
126 .TP 15
127 -n|--name \fIname \fR
128 Set name of man page (used in roff format). If the filename is
129 given in the form " \fIname \fR. \fIsection \fR", the name and
130 section are automatically determined. If the page is being parsed
131 from [tn]roff source and it has a .TH line, this information
132 is extracted from that line.
133 .TP 15
134 -p|--paragraph
135 paragraph mode toggle. The filter determines whether lines should
136 be linebroken as they were by nroff, or whether lines should
137 be flowed together into paragraphs. Mainly for internal use.
138 .TP 15
139 -s|section \fI# \fR
140 Set volume (aka section) number of man page (used in roff format).
141 tables
142 Turn on aggressive table parsing. -->
143 .TP 15
144 -t|--tabstops \fI# \fR
145 For those macros sets that use tabs in place of spaces where
146 possible in order to reduce the number of characters used, set
147 tabstops every \fI# \fR columns. Defaults to 8.
148 .SH "NOTES ON FILTER TYPES "
149 .SS "ROFF "
150 Some flavors of UNIX ship man page without [tn]roff source, making
151 one's laser printer little more than a laser-powered daisy wheel.
152 This filer tries to intuit the original [tn]roff directives,
153 which can then be recompiled by [tn]roff.
154 .SS "TkMan "
155 TkMan, a hypertext man page browser, uses \fIPolyglotMan \fR
156 to show man pages without the (usually) useless headers and footers
157 on each pages. It also collects section and (optionally) subsection
158 heads for direct access from a pulldown menu. TkMan and Tcl/Tk,
159 the toolkit in which it's written, are available via anonymous
160 ftp from \fIftp://ftp.smli.com/pub/tcl/ \fR
161 .SS "Tk "
162 This option outputs the text in a series of Tcl lists consisting
163 of text-tags pairs, where tag names roughly correspond to HTML.
164 This output can be inserted into a Tk text widget by doing an \fI
165 eval <textwidget> insert end <text> \fR. This format should be
166 relatively easily parsible by other programs that want both the
167 text and the tags. Also see ASCII.
168 .SS "ASCII "
169 When printed on a line printer, man pages try to produce special
170 text effects by overstriking characters with themselves (to produce
171 bold) and underscores (underlining). Other text processing software,
172 such as text editors, searchers, and indexers, must counteract
173 this. The ASCII filter strips away this formatting. Piping nroff
174 output through \fIcol -b \fR also strips away this formatting,
175 but it leaves behind unsightly page headers and footers. Also
176 see Tk.
177 .SS "Sections "
178 Dumps section and (optionally) subsection titles. This might
179 be useful for another program that processes man pages.
180 .SS "HTML "
181 With a simple extention to an HTTP server for Mosaic or other
182 World Wide Web browser, \fIPolyglotMan \fR can produce high quality
183 HTML on the fly. Several such extensions and pointers to several
184 others are included in \fIPolyglotMan \fR's \fIcontrib \fR directory.
185 .SS "SGML "
186 This is appoaching the Docbook DTD, but I'm hoping that someone
187 that someone with a real interest in this will polish the tags
188 generated. Try it to see how close the tags are now.
189 .SS "MIME "
190 MIME (Multipurpose Internet Mail Extensions) as defined by RFC 1563,
191 good for consumption by MIME-aware e-mailers or as Emacs (>=19.29)
192 enriched documents.
193 .SS "LaTeX and LaTeX2e "
194 Why not?
195 .SS "RTF "
196 Use output on Mac or NeXT or whatever. Maybe take random man
197 pages and integrate with NeXT's documentation system better.
198 Maybe NeXT has own man page macros that do this.
199 .SS "PostScript and FrameMaker "
200 To produce PostScript, use \fIgroff \fR or \fIpsroff \fR. To
201 produce FrameMaker MIF, use FrameMaker's builtin filter. In both
202 cases you need \fI[tn]roff \fR source, so if you only have a
203 formatted version of the manual page, use \fIPolyglotMan \fR's
204 roff filter first.
205 .SH "EXAMPLES "
206 To convert the \fIformatted \fR man page named \fIls.1 \fR back
207 into [tn]roff source form:
208 .PP
209 \fIrman -f roff /usr/local/man/cat1/ls.1 > /usr/local/man/man1/ls.1 \fR
210 .br
211 .PP
212 Long man pages are often compressed to conserve space (compression
213 is especially effective on formatted man pages as many of the
214 characters are spaces). As it is a long man page, it probably
215 has subsections, which we try to separate out (some macro sets
216 don't distinguish subsections well enough for \fIPolyglotMan \fR
217 to detect them). Let's convert this to LaTeX format:
218 .br
219 .PP
220 \fIpcat /usr/catman/a_man/cat1/automount.z | rman -b -n automount -s 1 -f
221 latex > automount.man \fR
222 .br
223 .PP
224 Alternatively, \fIman 1 automount | rman -b -n automount -s 1 -f
225 latex > automount.man \fR
226 .br
227 .PP
228 For HTML/Mosaic users, \fIPolyglotMan \fR can, without modification
229 of the source code, produce HTML links that point to other HTML
230 man pages either pregenerated or generated on the fly. First
231 let's assume pregenerated HTML versions of man pages stored in \fI/usr/man/html \fR.
232 Generate these one-by-one with the following form:
233 .br
234 \fIrman -f html -r 'http:/usr/man/html/%s.%s.html' /usr/man/cat1/ls.1 > /usr/man/html/ls.1.html \fR
235 .br
236 .PP
237 If you've extended your HTML client to generate HTML on the fly
238 you should use something like:
239 .br
240 \fIrman -f html -r 'http:~/bin/man2html?%s:%s' /usr/man/cat1/ls.1 \fR
241 .br
242 when generating HTML.
243 .SH "BUGS/INCOMPATIBILITIES "
244 \fIPolyglotMan \fR is not perfect in all cases, but it usually
245 does a good job, and in any case reduces the problem of converting
246 man pages to light editing.
247 .PP
248 Tables in formatted pages, especially H-P's, aren't handled very
249 well. Be sure to pass in source for the page to recognize tables.
250 .PP
251 The man pager \fIwoman \fR applies its own idea of formatting
252 for man pages, which can confuse \fIPolyglotMan \fR. Bypass \fI
253 woman \fR by passing the formatted manual page text directly
254 into \fIPolyglotMan \fR.
255 .PP
256 The [tn]roff output format uses fB to turn on boldface. If your
257 macro set requires .B, you'll have to a postprocess the \fIPolyglotMan \fR
258 output.
259 .SH "SEE ALSO "
260 \fItkman(1) \fR, \fIxman(1) \fR, \fIman(1) \fR, \fIman(7) \fR
261 or \fIman(5) \fR depending on your flavor of UNIX
262 .SH "AUTHOR "
263 PolyglotMan
264 .br
265 by Thomas A. Phelps ( \[email protected] \fR)
266 .br
267 developed at the
268 .br
269 University of California, Berkeley
270 .br
271 Computer Science Division
272 .PP
273 Manual page last updated on $Date: 1998/07/13 09:47:28 $