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