3 package Pod::Perldoc::ToRtf;
8 use base qw( Pod::Simple::RTF );
10 $VERSION # so that ->VERSION is happy
11 # stop CPAN from seeing this
13 $Pod::Simple::RTF::VERSION;
17 sub write_with_binmode { 0 }
18 sub output_extension { 'rtf' }
20 sub page_for_perldoc {
21 my($self, $tempfile, $perldoc) = @_;
22 return unless $perldoc->IS_MSWin32;
24 my $rtf_pager = $ENV{'RTFREADER'} || 'write.exe';
26 $perldoc->aside( "About to launch <\"$rtf_pager\" \"$tempfile\">\n" );
28 return 1 if system( qq{"$rtf_pager"}, qq{"$tempfile"} ) == 0;
37 Pod::Perldoc::ToRtf - let Perldoc render Pod as RTF
41 perldoc -o rtf Some::Modulename
45 This is a "plug-in" class that allows Perldoc to use
46 Pod::Simple::RTF as a formatter class.
48 This is actually a Pod::Simple::RTF subclass, and inherits
51 You have to have Pod::Simple::RTF installed (from the Pod::Simple dist),
52 or this module won't work.
54 If Perldoc is running under MSWin and uses this class as a formatter,
55 the output will be opened with F<write.exe> or whatever program is
56 specified in the environment variable C<RTFREADER>. For example, to
57 specify that RTF files should be opened the same as they are when you
58 double-click them, you would do C<set RTFREADER=start.exe> in your
61 Handy tip: put C<set PERLDOC=-ortf> in your F<autoexec.bat>
62 and that will set this class as the default formatter to run when
63 you do C<perldoc whatever>.
67 L<Pod::Simple::RTF>, L<Pod::Simple>, L<Pod::Perldoc>
69 =head1 COPYRIGHT AND DISCLAIMERS
71 Copyright (c) 2002 Sean M. Burke. All rights reserved.
73 This library is free software; you can redistribute it and/or modify it
74 under the same terms as Perl itself.
76 This program is distributed in the hope that it will be useful, but
77 without any warranty; without even the implied warranty of
78 merchantability or fitness for a particular purpose.
82 Sean M. Burke C<sburke@cpan.org>