1package Pod::Perldoc::ToRtf; 2use strict; 3use warnings; 4use parent qw( Pod::Simple::RTF ); 5 6use vars qw($VERSION); 7$VERSION = '3.19'; 8 9sub is_pageable { 0 } 10sub write_with_binmode { 0 } 11sub output_extension { 'rtf' } 12 13sub page_for_perldoc { 14 my($self, $tempfile, $perldoc) = @_; 15 return unless $perldoc->IS_MSWin32; 16 17 my $rtf_pager = $ENV{'RTFREADER'} || 'write.exe'; 18 19 $perldoc->aside( "About to launch <\"$rtf_pager\" \"$tempfile\">\n" ); 20 21 return 1 if system( qq{"$rtf_pager"}, qq{"$tempfile"} ) == 0; 22 return 0; 23} 24 251; 26__END__ 27 28=head1 NAME 29 30Pod::Perldoc::ToRtf - let Perldoc render Pod as RTF 31 32=head1 SYNOPSIS 33 34 perldoc -o rtf Some::Modulename 35 36=head1 DESCRIPTION 37 38This is a "plug-in" class that allows Perldoc to use 39Pod::Simple::RTF as a formatter class. 40 41This is actually a Pod::Simple::RTF subclass, and inherits 42all its options. 43 44You have to have Pod::Simple::RTF installed (from the Pod::Simple dist), 45or this module won't work. 46 47If Perldoc is running under MSWin and uses this class as a formatter, 48the output will be opened with F<write.exe> or whatever program is 49specified in the environment variable C<RTFREADER>. For example, to 50specify that RTF files should be opened the same as they are when you 51double-click them, you would do C<set RTFREADER=start.exe> in your 52F<autoexec.bat>. 53 54Handy tip: put C<set PERLDOC=-ortf> in your F<autoexec.bat> 55and that will set this class as the default formatter to run when 56you do C<perldoc whatever>. 57 58=head1 SEE ALSO 59 60L<Pod::Simple::RTF>, L<Pod::Simple>, L<Pod::Perldoc> 61 62=head1 COPYRIGHT AND DISCLAIMERS 63 64Copyright (c) 2002 Sean M. Burke. All rights reserved. 65 66This library is free software; you can redistribute it and/or modify it 67under the same terms as Perl itself. 68 69This program is distributed in the hope that it will be useful, but 70without any warranty; without even the implied warranty of 71merchantability or fitness for a particular purpose. 72 73=head1 AUTHOR 74 75Current maintainer: Mark Allen C<< <mallen@cpan.org> >> 76 77Past contributions from: 78brian d foy C<< <bdfoy@cpan.org> >> 79Adriano R. Ferreira C<< <ferreira@cpan.org> >>, 80Sean M. Burke C<< <sburke@cpan.org> >> 81 82=cut 83 84