File: pod2thread

package info (click to toggle)
libpod-thread-perl 3.01-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 368 kB
  • sloc: perl: 1,060; makefile: 3
file content (144 lines) | stat: -rwxr-xr-x 4,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!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
I<style>.  If this option is not given, no style sheet reference will be
included.

=item B<-t> I<title>, B<--title>=I<title>

Use I<title> as the title of the page rather than looking for a NAME section
in the POD document.

=back

=head1 DIAGNOSTICS

If B<pod2thread> fails with errors, see L<Pod::Thread> and L<Pod::Simple>
for information about what those errors might mean.  Internally, it can also
produce the following diagnostic:

=over 4

=item Unknown option: %s

(F) An unknown command line option was given.

=back

In addition, other L<Getopt::Long> error messages may result from invalid
command-line options.

=head1 AUTHOR

Russ Allbery <rra@cpan.org>

=head1 COPYRIGHT AND LICENSE

Copyright 2002, 2013, 2021 Russ Allbery <rra@cpan.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

=head1 SEE ALSO

L<Pod::Simple>, L<Pod::Thread>

This program is part of the Pod-Thread distribution.  The current version of
Pod-Thread is available from CPAN, or directly from its web site at
L<https://www.eyrie.org/~eagle/software/pod-thread/>.

=cut

# Local Variables:
# copyright-at-end-flag: t
# End: