Pod-Thread

 view release on metacpan or  search on metacpan

bin/pod2thread  view on Meta::CPAN

#!perl
#
# Convert POD data to the HTML macro language thread.
#
# SPDX-License-Identifier: MIT

use 5.024;
use autodie;
use warnings;

use Getopt::Long qw(GetOptions);
use Pod::Thread ();
use Pod::Usage qw(pod2usage);

# Insert -- into @ARGV before any single dash argument to hide it from
# Getopt::Long; we want to interpret it as meaning stdin.
my $stdin;
local @ARGV = map { $_ eq q{-} && !$stdin++ ? (q{--}, $_) : $_ } @ARGV;

# Parse our options.
my @options = qw(contents|c help|h navbar|n style|s=s title|t=s);
my %options;
Getopt::Long::config('bundling');
GetOptions(\%options, @options) or exit 1;
if ($options{help}) {
    pod2usage(1);
}

# Initialize and run the formatter.
my $parser = Pod::Thread->new(%options);
$parser->parse_from_file(@ARGV);

__END__

=for stopwords
Allbery STDIN STDOUT -chn --navbar subclasses MERCHANTABILITY NONINFRINGEMENT
sublicense

=head1 NAME

pod2thread - Convert POD data to the HTML macro language thread.

=head1 SYNOPSIS

B<pod2thread> [B<-chn>] [B<-s> I<style>] [B<-t> I<title>]
    [I<input> [I<output>]]

=head1 DESCRIPTION

B<pod2thread> is a front-end for L<Pod::Thread>.  It uses that module to
generate thread source from POD source.

I<input> is the file to read for POD source (the POD can be embedded in
code).  If I<input> isn't given, it defaults to STDIN.  I<output>, if given,
is the file to which to write the thread output.  If I<output> isn't given,
the output is written to STDOUT.

=head1 OPTIONS

=over 4

=item B<-c>, B<--contents>

Generate a table of contents as the first section of the resulting thread
file, with links to each top-level heading.

=item B<-n>, B<--navbar>

Generate a navigation bar at the top of the resulting thread file, with
links to each top-level heading.

=item B<-h>, B<--help>

Print out usage information and exit.

=item B<-s> I<style>, B<--style>=I<style>

In the generated thread source, include a reference to the style sheet



( run in 0.723 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )