pod2html.PL revision 7c478bd95313f5f23a4c958a745db2134aa03244
cdcc2371f3d464d82f58352c228873771e1e9879lutoff#!/usr/local/bin/perl
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffuse Config;
cdcc2371f3d464d82f58352c228873771e1e9879lutoffuse File::Basename qw(&basename &dirname);
cdcc2371f3d464d82f58352c228873771e1e9879lutoffuse Cwd;
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# List explicitly here the variables you want Configure to
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# generate. Metaconfig only looks for shell variables, so you
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac# have to mention them as if they were shell variables, not
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac# %Config entries. Thus you write
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# $startperl
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# to ensure Configure will look for $Config{startperl}.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# This forces PL files to create target in same directory as PL file.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac# This is so that make depend always knows where to find PL derivatives.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac$origdir = cwd;
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignacchdir dirname($0);
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac$file = basename($0, '.PL');
cdcc2371f3d464d82f58352c228873771e1e9879lutoff$file .= '.com' if $^O eq 'VMS';
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffopen OUT,">$file" or die "Can't create $file: $!";
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffprint "Extracting $file (with variable substitutions)\n";
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# In this section, perl variables will be expanded during extraction.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# You can use $Config{...} to use Configure variables.
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swiftprint OUT <<"!GROK!THIS!";
cdcc2371f3d464d82f58352c228873771e1e9879lutoff$Config{startperl}
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
950dae14045dfafef39e115efea5af8a78779bc9matthew_swift if \$running_under_some_shell;
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter!GROK!THIS!
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift
cdcc2371f3d464d82f58352c228873771e1e9879lutoff# In the following, perl variables are not expanded during extraction.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffprint OUT <<'!NO!SUBS!';
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=pod
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 NAME
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffpod2html - convert .pod files to .html files
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 SYNOPSIS
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff pod2html --help --htmlroot=<name> --infile=<name> --outfile=<name>
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --podpath=<name>:...:<name> --podroot=<name>
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --libpods=<name>:...:<name> --recurse --norecurse --verbose
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --index --noindex --title=<name>
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 DESCRIPTION
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
bb33f229dc0ad527a2e37d9be970df258a770399lutoffConverts files from pod format (see L<perlpod>) to HTML format.
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift=head1 ARGUMENTS
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffpod2html takes the following arguments:
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=over 4
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item help
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --help
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffDisplays the usage message.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item htmlroot
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --htmlroot=name
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suterSets the base URL for the HTML files. When cross-references are made,
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suterthe HTML root is prepended to the URL.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter=item infile
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --infile=name
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suterSpecify the pod file to convert. Input is taken from STDIN if no
cdcc2371f3d464d82f58352c228873771e1e9879lutoffinfile is specified.
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter=item outfile
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter --outfile=name
53247d28ba99538f841a13ea2cde01c3faa3ef36kenneth_suter
cdcc2371f3d464d82f58352c228873771e1e9879lutoffSpecify the HTML file to create. Output goes to STDOUT if no outfile
cdcc2371f3d464d82f58352c228873771e1e9879lutoffis specified.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item podroot
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --podroot=name
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffSpecify the base directory for finding library pods.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item podpath
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --podpath=name:...:name
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffSpecify which subdirectories of the podroot contain pod files whose
cdcc2371f3d464d82f58352c228873771e1e9879lutoffHTML converted forms can be linked-to in cross-references.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item libpods
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --libpods=name:...:name
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffList of page names (eg, "perlfunc") which contain linkable C<=item>s.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item netscape
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --netscape
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffUse Netscape HTML directives when applicable.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item nonetscape
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --nonetscape
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
1931bd82f2c530a782d76c62428b15c6c3af1fbflutoffDo not use Netscape HTML directives (default).
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item index
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --index
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffGenerate an index at the top of the HTML file (default behaviour).
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item noindex
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --noindex
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffDo not generate an index at the top of the HTML file.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item recurse
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --recurse
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffRecurse into subdirectories specified in podpath (default behaviour).
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
abb16d70d9d4b5daf29b49db1e78676d4609276amatthew_swift=item norecurse
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --norecurse
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffDo not recurse into subdirectories specified in podpath.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item title
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --title=title
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffSpecify the title of the resulting HTML file.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=item verbose
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff --verbose
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffDisplay progress messages.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=back
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 AUTHOR
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffTom Christiansen, E<lt>tchrist@perl.comE<gt>.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 BUGS
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffSee L<Pod::Html> for a list of known bugs in the translator.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 SEE ALSO
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffL<perlpod>, L<Pod::Html>
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=head1 COPYRIGHT
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffThis program is distributed under the Artistic License.
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoff=cut
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffuse Pod::Html;
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffpod2html @ARGV;
cdcc2371f3d464d82f58352c228873771e1e9879lutoff!NO!SUBS!
cdcc2371f3d464d82f58352c228873771e1e9879lutoff
cdcc2371f3d464d82f58352c228873771e1e9879lutoffclose OUT or die "Can't close $file: $!";
cdcc2371f3d464d82f58352c228873771e1e9879lutoffchmod 0755, $file or die "Can't reset permissions for $file: $!\n";
cdcc2371f3d464d82f58352c228873771e1e9879lutoffexec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
cdcc2371f3d464d82f58352c228873771e1e9879lutoffchdir $origdir;
cdcc2371f3d464d82f58352c228873771e1e9879lutoff