typo in change#3768
[p5sagit/p5-mst-13.2.git] / pod / pod2html.PL
CommitLineData
4633a7c4 1#!/usr/local/bin/perl
2
3use Config;
4use File::Basename qw(&basename &dirname);
5
6# List explicitly here the variables you want Configure to
7# generate. Metaconfig only looks for shell variables, so you
8# have to mention them as if they were shell variables, not
9# %Config entries. Thus you write
10# $startperl
11# to ensure Configure will look for $Config{startperl}.
12
b233458b 13$file = basename($0);
14$file =~ s/\.PL$//i;
774d564b 15$file .= '.com' if $^O eq 'VMS';
4633a7c4 16
b233458b 17chdir("pod") or die "Can't chdir to pod: $!";
4633a7c4 18open OUT,">$file" or die "Can't create $file: $!";
19
20print "Extracting $file (with variable substitutions)\n";
21
22# In this section, perl variables will be expanded during extraction.
23# You can use $Config{...} to use Configure variables.
24
25print OUT <<"!GROK!THIS!";
5f05dabc 26$Config{startperl}
27 eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
28 if \$running_under_some_shell;
4633a7c4 29!GROK!THIS!
30
31# In the following, perl variables are not expanded during extraction.
32
33print OUT <<'!NO!SUBS!';
54310121 34=pod
5f05dabc 35
54310121 36=head1 NAME
5e71e875 37
54310121 38pod2html - convert .pod files to .html files
39
40=head1 SYNOPSIS
41
42 pod2html --help --htmlroot=<name> --infile=<name> --outfile=<name>
43 --podpath=<name>:...:<name> --podroot=<name>
44 --libpods=<name>:...:<name> --recurse --norecurse --verbose
45 --index --noindex --title=<name>
46
47=head1 DESCRIPTION
48
49Converts files from pod format (see L<perlpod>) to HTML format.
50
51=head1 ARGUMENTS
52
53pod2html takes the following arguments:
54
55=over 4
56
57=item help
58
59 --help
60
61Displays the usage message.
62
63=item htmlroot
64
65 --htmlroot=name
66
67Sets the base URL for the HTML files. When cross-references are made,
68the HTML root is prepended to the URL.
69
70=item infile
71
72 --infile=name
73
74Specify the pod file to convert. Input is taken from STDIN if no
75infile is specified.
76
77=item outfile
78
79 --outfile=name
80
81Specify the HTML file to create. Output goes to STDOUT if no outfile
82is specified.
83
84=item podroot
85
86 --podroot=name
87
88Specify the base directory for finding library pods.
89
90=item podpath
91
92 --podpath=name:...:name
93
94Specify which subdirectories of the podroot contain pod files whose
95HTML converted forms can be linked-to in cross-references.
96
97=item libpods
98
99 --libpods=name:...:name
100
101List of page names (eg, "perlfunc") which contain linkable C<=item>s.
102
103=item netscape
104
105 --netscape
106
107Use Netscape HTML directives when applicable.
108
109=item nonetscape
110
111 --nonetscape
112
113Do not use Netscape HTML directives (default).
114
115=item index
116
117 --index
118
119Generate an index at the top of the HTML file (default behaviour).
120
121=item noindex
122
123 --noindex
124
125Do not generate an index at the top of the HTML file.
126
127
128=item recurse
129
130 --recurse
131
132Recurse into subdirectories specified in podpath (default behaviour).
133
134=item norecurse
135
136 --norecurse
137
138Do not recurse into subdirectories specified in podpath.
139
140=item title
141
142 --title=title
143
144Specify the title of the resulting HTML file.
145
146=item verbose
147
148 --verbose
149
150Display progress messages.
151
152=back
153
154=head1 AUTHOR
155
156Tom Christiansen, E<lt>tchrist@perl.comE<gt>.
157
158=head1 BUGS
159
160See L<Pod::Html> for a list of known bugs in the translator.
161
162=head1 SEE ALSO
163
c1bd1124 164L<perlpod>, L<Pod::Html>
54310121 165
166=head1 COPYRIGHT
167
168This program is distributed under the Artistic License.
169
170=cut
171
172use Pod::Html;
173
174pod2html @ARGV;
4633a7c4 175!NO!SUBS!
176
177close OUT or die "Can't close $file: $!";
178chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
179exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
b233458b 180