diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2011-02-17 17:32:35 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2011-02-17 17:32:35 +0000 |
commit | 539135f1864a2356d0eb3666e0f5b335680872a4 (patch) | |
tree | 3b214294c17073dfdfbdba13b72b6fa2d10a0a6e /Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm | |
parent | 227723589c9564b9b2b7042dd27eb9aad56a560a (diff) |
New tlperl part XII
git-svn-id: svn://tug.org/texlive/trunk@21434 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm new file mode 100644 index 00000000000..29a3b7d108e --- /dev/null +++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm @@ -0,0 +1,81 @@ + +require 5; +package Pod::Perldoc::BaseTo; +use strict; +use warnings; + +sub is_pageable { '' } +sub write_with_binmode { 1 } + +sub output_extension { 'txt' } # override in subclass! + +# sub new { my $self = shift; ... } +# sub parse_from_file( my($class, $in, $out) = ...; ... } + +#sub new { return bless {}, ref($_[0]) || $_[0] } + +sub _perldoc_elem { + my($self, $name) = splice @_,0,2; + if(@_) { + $self->{$name} = $_[0]; + } else { + $self->{$name}; + } +} + + +1; + +__END__ + +=head1 NAME + +Pod::Perldoc::BaseTo - Base for Pod::Perldoc formatters + +=head1 SYNOPSIS + + package Pod::Perldoc::ToMyFormat; + + use base qw( Pod::Perldoc::BaseTo ); + ... + +=head1 DESCRIPTION + +This package is meant as a base of Pod::Perldoc formatters, +like L<Pod::Perldoc::ToText>, L<Pod::Perldoc::ToMan>, etc. + +It provides default implementations for the methods + + is_pageable + write_with_binmode + output_extension + _perldoc_elem + +The concrete formatter must implement + + new + parse_from_file + +=head1 SEE ALSO + +L<perldoc> + +=head1 COPYRIGHT AND DISCLAIMERS + +Copyright (c) 2002-2007 Sean M. Burke. + +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +This program is distributed in the hope that it will be useful, but +without any warranty; without even the implied warranty of +merchantability or fitness for a particular purpose. + +=head1 AUTHOR + +Current maintainer: Adriano R. Ferreira <ferreira@cpan.org> + +Past contributions from: +Sean M. Burke <sburke@cpan.org> + +=cut |