From 539135f1864a2356d0eb3666e0f5b335680872a4 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Thu, 17 Feb 2011 17:32:35 +0000 Subject: New tlperl part XII git-svn-id: svn://tug.org/texlive/trunk@21434 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm | 81 +++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm (limited to 'Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm') 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, L, 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 + +=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 + +Past contributions from: +Sean M. Burke + +=cut -- cgit v1.2.3