Commit | Line | Data |
1a67fee7 |
1 | |
2 | require 5; |
3 | package Pod::Perldoc::BaseTo; |
4 | use strict; |
5 | use warnings; |
6 | |
7 | sub is_pageable { '' } |
8 | sub write_with_binmode { 1 } |
9 | |
10 | sub output_extension { 'txt' } # override in subclass! |
11 | |
12 | # sub new { my $self = shift; ... } |
13 | # sub parse_from_file( my($class, $in, $out) = ...; ... } |
14 | |
15 | #sub new { return bless {}, ref($_[0]) || $_[0] } |
16 | |
17 | sub _perldoc_elem { |
18 | my($self, $name) = splice @_,0,2; |
19 | if(@_) { |
20 | $self->{$name} = $_[0]; |
21 | } else { |
22 | $self->{$name}; |
23 | } |
24 | } |
25 | |
26 | |
27 | 1; |
28 | |
91a46224 |
29 | __END__ |
30 | |
31 | =head1 NAME |
32 | |
33 | Pod::Perldoc::BaseTo - Base for Pod::Perldoc formatters |
34 | |
35 | =head1 SYNOPSIS |
36 | |
37 | package Pod::Perldoc::ToMyFormat; |
38 | |
39 | use base qw( Pod::Perldoc::BaseTo ); |
40 | ... |
41 | |
42 | =head1 DESCRIPTION |
43 | |
44 | This package is meant as a base of Pod::Perldoc formatters, |
45 | like L<Pod::Perldoc::ToText>, L<Pod::Perldoc::ToMan>, etc. |
46 | |
47 | It provides default implementations for the methods |
48 | |
49 | is_pageable |
50 | write_with_binmode |
51 | output_extension |
52 | _perldoc_elem |
53 | |
54 | The concrete formatter must implement |
55 | |
56 | new |
57 | parse_from_file |
58 | |
59 | =head1 SEE ALSO |
60 | |
61 | L<perldoc> |
62 | |
63 | =head1 COPYRIGHT AND DISCLAIMERS |
64 | |
65 | Copyright (c) 2002-2007 Sean M. Burke. |
66 | |
67 | This library is free software; you can redistribute it and/or modify it |
68 | under the same terms as Perl itself. |
69 | |
70 | This program is distributed in the hope that it will be useful, but |
71 | without any warranty; without even the implied warranty of |
72 | merchantability or fitness for a particular purpose. |
73 | |
74 | =head1 AUTHOR |
75 | |
76 | Current maintainer: Adriano R. Ferreira <ferreira@cpan.org> |
77 | |
78 | Past contributions from: |
79 | Sean M. Burke <sburke@cpan.org> |
80 | |
81 | =cut |