xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Pod/Perldoc/ToRtf.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gate
2*0Sstevel@tonic-gaterequire 5;
3*0Sstevel@tonic-gatepackage Pod::Perldoc::ToRtf;
4*0Sstevel@tonic-gateuse strict;
5*0Sstevel@tonic-gateuse warnings;
6*0Sstevel@tonic-gateuse vars qw($VERSION);
7*0Sstevel@tonic-gate
8*0Sstevel@tonic-gateuse base qw( Pod::Simple::RTF );
9*0Sstevel@tonic-gate
10*0Sstevel@tonic-gate$VERSION   # so that ->VERSION is happy
11*0Sstevel@tonic-gate# stop CPAN from seeing this
12*0Sstevel@tonic-gate =
13*0Sstevel@tonic-gate$Pod::Simple::RTF::VERSION;
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gate
16*0Sstevel@tonic-gatesub is_pageable        { 0 }
17*0Sstevel@tonic-gatesub write_with_binmode { 0 }
18*0Sstevel@tonic-gatesub output_extension   { 'rtf' }
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gatesub page_for_perldoc {
21*0Sstevel@tonic-gate  my($self, $tempfile, $perldoc) = @_;
22*0Sstevel@tonic-gate  return unless $perldoc->IS_MSWin32;
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate  my $rtf_pager = $ENV{'RTFREADER'} || 'write.exe';
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate  $perldoc->aside( "About to launch <\"$rtf_pager\" \"$tempfile\">\n" );
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate  return 1 if system( qq{"$rtf_pager"}, qq{"$tempfile"} ) == 0;
29*0Sstevel@tonic-gate  return 0;
30*0Sstevel@tonic-gate}
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate1;
33*0Sstevel@tonic-gate__END__
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gate=head1 NAME
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gatePod::Perldoc::ToRtf - let Perldoc render Pod as RTF
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gate=head1 SYNOPSIS
40*0Sstevel@tonic-gate
41*0Sstevel@tonic-gate  perldoc -o rtf Some::Modulename
42*0Sstevel@tonic-gate
43*0Sstevel@tonic-gate=head1 DESCRIPTION
44*0Sstevel@tonic-gate
45*0Sstevel@tonic-gateThis is a "plug-in" class that allows Perldoc to use
46*0Sstevel@tonic-gatePod::Simple::RTF as a formatter class.
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gateThis is actually a Pod::Simple::RTF subclass, and inherits
49*0Sstevel@tonic-gateall its options.
50*0Sstevel@tonic-gate
51*0Sstevel@tonic-gateYou have to have Pod::Simple::RTF installed (from the Pod::Simple dist),
52*0Sstevel@tonic-gateor this module won't work.
53*0Sstevel@tonic-gate
54*0Sstevel@tonic-gateIf Perldoc is running under MSWin and uses this class as a formatter,
55*0Sstevel@tonic-gatethe output will be opened with F<write.exe> or whatever program is
56*0Sstevel@tonic-gatespecified in the environment variable C<RTFREADER>. For example, to
57*0Sstevel@tonic-gatespecify that RTF files should be opened the same as they are when you
58*0Sstevel@tonic-gatedouble-click them, you would do C<set RTFREADER=start.exe> in your
59*0Sstevel@tonic-gateF<autoexec.bat>.
60*0Sstevel@tonic-gate
61*0Sstevel@tonic-gateHandy tip: put C<set PERLDOC=-ortf> in your F<autoexec.bat>
62*0Sstevel@tonic-gateand that will set this class as the default formatter to run when
63*0Sstevel@tonic-gateyou do C<perldoc whatever>.
64*0Sstevel@tonic-gate
65*0Sstevel@tonic-gate=head1 SEE ALSO
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gateL<Pod::Simple::RTF>, L<Pod::Simple>, L<Pod::Perldoc>
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate=head1 COPYRIGHT AND DISCLAIMERS
70*0Sstevel@tonic-gate
71*0Sstevel@tonic-gateCopyright (c) 2002 Sean M. Burke.  All rights reserved.
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gateThis library is free software; you can redistribute it and/or modify it
74*0Sstevel@tonic-gateunder the same terms as Perl itself.
75*0Sstevel@tonic-gate
76*0Sstevel@tonic-gateThis program is distributed in the hope that it will be useful, but
77*0Sstevel@tonic-gatewithout any warranty; without even the implied warranty of
78*0Sstevel@tonic-gatemerchantability or fitness for a particular purpose.
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate=head1 AUTHOR
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gateSean M. Burke C<sburke@cpan.org>
83*0Sstevel@tonic-gate
84*0Sstevel@tonic-gate=cut
85*0Sstevel@tonic-gate
86