xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Pod/Perldoc/ToNroff.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gate
2*0Sstevel@tonic-gaterequire 5;
3*0Sstevel@tonic-gatepackage Pod::Perldoc::ToNroff;
4*0Sstevel@tonic-gateuse strict;
5*0Sstevel@tonic-gateuse warnings;
6*0Sstevel@tonic-gate
7*0Sstevel@tonic-gate# This is unlike ToMan.pm in that it emits the raw nroff source!
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gateuse base qw(Pod::Perldoc::BaseTo);
10*0Sstevel@tonic-gate
11*0Sstevel@tonic-gatesub is_pageable        { 1 }  # well, if you ask for it...
12*0Sstevel@tonic-gatesub write_with_binmode { 0 }
13*0Sstevel@tonic-gatesub output_extension   { 'man' }
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gateuse Pod::Man ();
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gatesub center          { shift->_perldoc_elem('center'         , @_) }
18*0Sstevel@tonic-gatesub date            { shift->_perldoc_elem('date'           , @_) }
19*0Sstevel@tonic-gatesub fixed           { shift->_perldoc_elem('fixed'          , @_) }
20*0Sstevel@tonic-gatesub fixedbold       { shift->_perldoc_elem('fixedbold'      , @_) }
21*0Sstevel@tonic-gatesub fixeditalic     { shift->_perldoc_elem('fixeditalic'    , @_) }
22*0Sstevel@tonic-gatesub fixedbolditalic { shift->_perldoc_elem('fixedbolditalic', @_) }
23*0Sstevel@tonic-gatesub quotes          { shift->_perldoc_elem('quotes'         , @_) }
24*0Sstevel@tonic-gatesub release         { shift->_perldoc_elem('release'        , @_) }
25*0Sstevel@tonic-gatesub section         { shift->_perldoc_elem('section'        , @_) }
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gatesub new { return bless {}, ref($_[0]) || $_[0] }
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gatesub parse_from_file {
30*0Sstevel@tonic-gate  my $self = shift;
31*0Sstevel@tonic-gate  my $file = $_[0];
32*0Sstevel@tonic-gate
33*0Sstevel@tonic-gate  my @options =
34*0Sstevel@tonic-gate    map {; $_, $self->{$_} }
35*0Sstevel@tonic-gate      grep !m/^_/s,
36*0Sstevel@tonic-gate        keys %$self
37*0Sstevel@tonic-gate  ;
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gate  defined(&Pod::Perldoc::DEBUG)
40*0Sstevel@tonic-gate   and Pod::Perldoc::DEBUG()
41*0Sstevel@tonic-gate   and print "About to call new Pod::Man ",
42*0Sstevel@tonic-gate    $Pod::Man::VERSION ? "(v$Pod::Man::VERSION) " : '',
43*0Sstevel@tonic-gate    "with options: ",
44*0Sstevel@tonic-gate    @options ? "[@options]" : "(nil)", "\n";
45*0Sstevel@tonic-gate  ;
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gate  Pod::Man->new(@options)->parse_from_file(@_);
48*0Sstevel@tonic-gate}
49*0Sstevel@tonic-gate
50*0Sstevel@tonic-gate1;
51*0Sstevel@tonic-gate__END__
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gate=head1 NAME
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gatePod::Perldoc::ToNroff - let Perldoc convert Pod to nroff
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate=head1 SYNOPSIS
58*0Sstevel@tonic-gate
59*0Sstevel@tonic-gate  perldoc -o nroff -d something.3 Some::Modulename
60*0Sstevel@tonic-gate
61*0Sstevel@tonic-gate=head1 DESCRIPTION
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gateThis is a "plug-in" class that allows Perldoc to use
64*0Sstevel@tonic-gatePod::Man as a formatter class.
65*0Sstevel@tonic-gate
66*0Sstevel@tonic-gateThe following options are supported:  center, date, fixed, fixedbold,
67*0Sstevel@tonic-gatefixeditalic, fixedbolditalic, quotes, release, section
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gateThose options are explained in L<Pod::Man>.
70*0Sstevel@tonic-gate
71*0Sstevel@tonic-gateFor example:
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate  perldoc -o nroff -w center:Pod -d something.3 Some::Modulename
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate=head1 CAVEAT
76*0Sstevel@tonic-gate
77*0Sstevel@tonic-gateThis module may change to use a different pod-to-nroff formatter class
78*0Sstevel@tonic-gatein the future, and this may change what options are supported.
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate=head1 SEE ALSO
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gateL<Pod::Man>, L<Pod::Perldoc>, L<Pod::Perldoc::ToMan>
83*0Sstevel@tonic-gate
84*0Sstevel@tonic-gate=head1 COPYRIGHT AND DISCLAIMERS
85*0Sstevel@tonic-gate
86*0Sstevel@tonic-gateCopyright (c) 2002 Sean M. Burke.  All rights reserved.
87*0Sstevel@tonic-gate
88*0Sstevel@tonic-gateThis library is free software; you can redistribute it and/or modify it
89*0Sstevel@tonic-gateunder the same terms as Perl itself.
90*0Sstevel@tonic-gate
91*0Sstevel@tonic-gateThis program is distributed in the hope that it will be useful, but
92*0Sstevel@tonic-gatewithout any warranty; without even the implied warranty of
93*0Sstevel@tonic-gatemerchantability or fitness for a particular purpose.
94*0Sstevel@tonic-gate
95*0Sstevel@tonic-gate=head1 AUTHOR
96*0Sstevel@tonic-gate
97*0Sstevel@tonic-gateSean M. Burke C<sburke@cpan.org>
98*0Sstevel@tonic-gate
99*0Sstevel@tonic-gate=cut
100*0Sstevel@tonic-gate
101