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