xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm (revision 9f11ffb7133c203312a01e4b986886bc88c7d74b)
1898184e3Ssthenpackage Pod::Perldoc::ToRtf;
2898184e3Ssthenuse strict;
3898184e3Ssthenuse warnings;
4898184e3Ssthenuse parent qw( Pod::Simple::RTF );
5898184e3Ssthen
6898184e3Ssthenuse vars qw($VERSION);
7*9f11ffb7Safresh1$VERSION = '3.28';
8898184e3Ssthen
9898184e3Ssthensub is_pageable        { 0 }
10898184e3Ssthensub write_with_binmode { 0 }
11898184e3Ssthensub output_extension   { 'rtf' }
12898184e3Ssthen
13898184e3Ssthensub page_for_perldoc {
14898184e3Ssthen  my($self, $tempfile, $perldoc) = @_;
15898184e3Ssthen  return unless $perldoc->IS_MSWin32;
16898184e3Ssthen
17898184e3Ssthen  my $rtf_pager = $ENV{'RTFREADER'} || 'write.exe';
18898184e3Ssthen
19898184e3Ssthen  $perldoc->aside( "About to launch <\"$rtf_pager\" \"$tempfile\">\n" );
20898184e3Ssthen
21898184e3Ssthen  return 1 if system( qq{"$rtf_pager"}, qq{"$tempfile"} ) == 0;
22898184e3Ssthen  return 0;
23898184e3Ssthen}
24898184e3Ssthen
25898184e3Ssthen1;
26898184e3Ssthen__END__
27898184e3Ssthen
28898184e3Ssthen=head1 NAME
29898184e3Ssthen
30898184e3SsthenPod::Perldoc::ToRtf - let Perldoc render Pod as RTF
31898184e3Ssthen
32898184e3Ssthen=head1 SYNOPSIS
33898184e3Ssthen
34898184e3Ssthen  perldoc -o rtf Some::Modulename
35898184e3Ssthen
36898184e3Ssthen=head1 DESCRIPTION
37898184e3Ssthen
38898184e3SsthenThis is a "plug-in" class that allows Perldoc to use
39898184e3SsthenPod::Simple::RTF as a formatter class.
40898184e3Ssthen
41898184e3SsthenThis is actually a Pod::Simple::RTF subclass, and inherits
42898184e3Ssthenall its options.
43898184e3Ssthen
44898184e3SsthenYou have to have Pod::Simple::RTF installed (from the Pod::Simple dist),
45898184e3Ssthenor this module won't work.
46898184e3Ssthen
47898184e3SsthenIf Perldoc is running under MSWin and uses this class as a formatter,
48898184e3Ssthenthe output will be opened with F<write.exe> or whatever program is
49898184e3Ssthenspecified in the environment variable C<RTFREADER>. For example, to
50898184e3Ssthenspecify that RTF files should be opened the same as they are when you
51898184e3Ssthendouble-click them, you would do C<set RTFREADER=start.exe> in your
52898184e3SsthenF<autoexec.bat>.
53898184e3Ssthen
54898184e3SsthenHandy tip: put C<set PERLDOC=-ortf> in your F<autoexec.bat>
55898184e3Ssthenand that will set this class as the default formatter to run when
56898184e3Ssthenyou do C<perldoc whatever>.
57898184e3Ssthen
58898184e3Ssthen=head1 SEE ALSO
59898184e3Ssthen
60898184e3SsthenL<Pod::Simple::RTF>, L<Pod::Simple>, L<Pod::Perldoc>
61898184e3Ssthen
62898184e3Ssthen=head1 COPYRIGHT AND DISCLAIMERS
63898184e3Ssthen
64898184e3SsthenCopyright (c) 2002 Sean M. Burke.  All rights reserved.
65898184e3Ssthen
66898184e3SsthenThis library is free software; you can redistribute it and/or modify it
67898184e3Ssthenunder the same terms as Perl itself.
68898184e3Ssthen
69898184e3SsthenThis program is distributed in the hope that it will be useful, but
70898184e3Ssthenwithout any warranty; without even the implied warranty of
71898184e3Ssthenmerchantability or fitness for a particular purpose.
72898184e3Ssthen
73898184e3Ssthen=head1 AUTHOR
74898184e3Ssthen
75898184e3SsthenCurrent maintainer: Mark Allen C<< <mallen@cpan.org> >>
76898184e3Ssthen
77898184e3SsthenPast contributions from:
78898184e3Ssthenbrian d foy C<< <bdfoy@cpan.org> >>
79898184e3SsthenAdriano R. Ferreira C<< <ferreira@cpan.org> >>,
80898184e3SsthenSean M. Burke C<< <sburke@cpan.org> >>
81898184e3Ssthen
82898184e3Ssthen=cut
83898184e3Ssthen
84