"Fossies" - the Fresh Open Source Software Archive

Member "install-tl-20200916/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm" (8 Mar 2018, 2266 Bytes) of package /windows/misc/install-tl.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package Pod::Perldoc::ToText;
    2 use strict;
    3 use warnings;
    4 
    5 use vars qw($VERSION);
    6 $VERSION = '3.28';
    7 
    8 use parent qw(Pod::Perldoc::BaseTo);
    9 
   10 sub is_pageable        { 1 }
   11 sub write_with_binmode { 0 }
   12 sub output_extension   { 'txt' }
   13 
   14 use Pod::Text ();
   15 
   16 sub alt       { shift->_perldoc_elem('alt'     , @_) }
   17 sub indent    { shift->_perldoc_elem('indent'  , @_) }
   18 sub loose     { shift->_perldoc_elem('loose'   , @_) }
   19 sub quotes    { shift->_perldoc_elem('quotes'  , @_) }
   20 sub sentence  { shift->_perldoc_elem('sentence', @_) }
   21 sub width     { shift->_perldoc_elem('width'   , @_) }
   22 
   23 sub new { return bless {}, ref($_[0]) || $_[0] }
   24 
   25 sub parse_from_file {
   26   my $self = shift;
   27 
   28   my @options =
   29     map {; $_, $self->{$_} }
   30       grep !m/^_/s,
   31         keys %$self
   32   ;
   33 
   34   defined(&Pod::Perldoc::DEBUG)
   35    and Pod::Perldoc::DEBUG()
   36    and print "About to call new Pod::Text ",
   37     $Pod::Text::VERSION ? "(v$Pod::Text::VERSION) " : '',
   38     "with options: ",
   39     @options ? "[@options]" : "(nil)", "\n";
   40   ;
   41 
   42   Pod::Text->new(@options)->parse_from_file(@_);
   43 }
   44 
   45 1;
   46 
   47 =head1 NAME
   48 
   49 Pod::Perldoc::ToText - let Perldoc render Pod as plaintext
   50 
   51 =head1 SYNOPSIS
   52 
   53   perldoc -o text Some::Modulename
   54 
   55 =head1 DESCRIPTION
   56 
   57 This is a "plug-in" class that allows Perldoc to use
   58 Pod::Text as a formatter class.
   59 
   60 It supports the following options, which are explained in
   61 L<Pod::Text>: alt, indent, loose, quotes, sentence, width
   62 
   63 For example:
   64 
   65   perldoc -o text -w indent:5 Some::Modulename
   66 
   67 =head1 CAVEAT
   68 
   69 This module may change to use a different text formatter class in the
   70 future, and this may change what options are supported.
   71 
   72 =head1 SEE ALSO
   73 
   74 L<Pod::Text>, L<Pod::Perldoc>
   75 
   76 =head1 COPYRIGHT AND DISCLAIMERS
   77 
   78 Copyright (c) 2002 Sean M. Burke.  All rights reserved.
   79 
   80 This library is free software; you can redistribute it and/or modify it
   81 under the same terms as Perl itself.
   82 
   83 This program is distributed in the hope that it will be useful, but
   84 without any warranty; without even the implied warranty of
   85 merchantability or fitness for a particular purpose.
   86 
   87 =head1 AUTHOR
   88 
   89 Current maintainer: Mark Allen C<< <mallen@cpan.org> >>
   90 
   91 Past contributions from:
   92 brian d foy C<< <bdfoy@cpan.org> >>
   93 Adriano R. Ferreira C<< <ferreira@cpan.org> >>,
   94 Sean M. Burke C<< <sburke@cpan.org> >>
   95 
   96 
   97 =cut
   98