Skip to content

Commit

Permalink
* initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
eserte committed Jul 31, 2009
0 parents commit 5a7e5d9
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MANIFEST
@@ -0,0 +1,5 @@
lib/Pod/Perldoc/ToTextOverstrike.pm
lib/Pod/Perldoc/ToTextTermcap.pm
Makefile.PL
MANIFEST This list of files
t/00-basic.t
32 changes: 32 additions & 0 deletions Makefile.PL
@@ -0,0 +1,32 @@
use strict;
use ExtUtils::MakeMaker;

my $is_devel_host = defined $ENV{USER} && $ENV{USER} eq 'eserte' && $^O =~ /bsd/i && -f "../../perl.release.mk";

WriteMakefile(
NAME => 'Pod::Perldoc::ToTextTermcap',
AUTHOR => 'Slaven Rezic <srezic@cpan.org>',
VERSION_FROM => 'lib/Pod/Perldoc/ToTextTermcap.pm',
ABSTRACT_FROM => 'lib/Pod/Perldoc/ToTextTermcap.pm',
PL_FILES => {},
PREREQ_PM => {
'Pod::Perldoc::ToText' => 0,
'Pod::Text::Termcap' => 0,
'Pod::Text::Overstrike' => 0,
},
);

sub MY::postamble {
my $postamble = '';

if ($is_devel_host) {
$postamble .= <<'EOF';
.include "../../perl.release.mk"
.include "../../perl.cvs.mk"
EOF
}

$postamble;
}
83 changes: 83 additions & 0 deletions lib/Pod/Perldoc/ToTextOverstrike.pm
@@ -0,0 +1,83 @@
# -*- perl -*-

#
# Author: Slaven Rezic
#
# Copyright (C) 2009 Slaven Rezic. All rights reserved.
# This package is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
# Mail: slaven@rezic.de
# WWW: http://www.rezic.de/eserte/
#

require 5;
package Pod::Perldoc::ToTextOverstrike;
use strict;
use warnings;

use vars qw($VERSION);
$VERSION = "0.00_50";

use base qw(Pod::Perldoc::ToText);

use Pod::Text::Overstrike ();

sub parse_from_file {
my $self = shift;

my @options =
map {; $_, $self->{$_} }
grep !m/^_/s,
keys %$self
;

defined(&Pod::Perldoc::DEBUG)
and Pod::Perldoc::DEBUG()
and print "About to call new Pod::Text::Overstrike ",
$Pod::Text::Overstrike::VERSION ? "(v$Pod::Text::Overstrike::VERSION) " : '',
"with options: ",
@options ? "[@options]" : "(nil)", "\n";
;

Pod::Text::Overstrike->new(@options)->parse_from_file(@_);
}

1;

__END__
=head1 NAME
Pod::Perldoc::ToTextOverstrike - let Perldoc render Pod as formatted overstrike text
=head1 SYNOPSIS
perldoc -MPod::Perldoc::ToTextOverstrike Some::Modulename
=head1 DESCRIPTION
This is a "plug-in" class that allows Perldoc to use
L<Pod::Text::Overstrike> as a formatter class.
It supports all options supported by L<Pod::Perldoc::ToText>.
=head1 SEE ALSO
L<Pod::Text::Overstrike>, L<Pod::Perldoc>, L<Pod::Perldoc::ToText>
=head1 COPYRIGHT
Copyright (c) 2009 Slaven ReziE<x0107>. All rights reserved.
This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 AUTHOR
Slaven ReziE<x0107> <srezic@cpan.org>.
Based on L<Pod::Perldoc::ToText> which is by Sean M. Burke
<sburke@cpan.org> and Adriano R. Ferreira <ferreira@cpan.org>.
=cut
83 changes: 83 additions & 0 deletions lib/Pod/Perldoc/ToTextTermcap.pm
@@ -0,0 +1,83 @@
# -*- perl -*-

#
# Author: Slaven Rezic
#
# Copyright (C) 2009 Slaven Rezic. All rights reserved.
# This package is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
# Mail: slaven@rezic.de
# WWW: http://www.rezic.de/eserte/
#

require 5;
package Pod::Perldoc::ToTextTermcap;
use strict;
use warnings;

use vars qw($VERSION);
$VERSION = "0.00_50";

use base qw(Pod::Perldoc::ToText);

use Pod::Text::Termcap ();

sub parse_from_file {
my $self = shift;

my @options =
map {; $_, $self->{$_} }
grep !m/^_/s,
keys %$self
;

defined(&Pod::Perldoc::DEBUG)
and Pod::Perldoc::DEBUG()
and print "About to call new Pod::Text::Termcap ",
$Pod::Text::Termcap::VERSION ? "(v$Pod::Text::Termcap::VERSION) " : '',
"with options: ",
@options ? "[@options]" : "(nil)", "\n";
;

Pod::Text::Termcap->new(@options)->parse_from_file(@_);
}

1;

__END__
=head1 NAME
Pod::Perldoc::ToTextTermcap - let Perldoc render Pod as plaintext with format escapes
=head1 SYNOPSIS
perldoc -MPod::Perldoc::ToTextTermcap Some::Modulename
=head1 DESCRIPTION
This is a "plug-in" class that allows Perldoc to use
L<Pod::Text::Termcap> as a formatter class.
It supports all options supported by L<Pod::Perldoc::ToText>.
=head1 SEE ALSO
L<Pod::Text::Termcap>, L<Pod::Perldoc>, L<Pod::Perldoc::ToText>
=head1 COPYRIGHT
Copyright (c) 2009 Slaven ReziE<x0107>. All rights reserved.
This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 AUTHOR
Slaven ReziE<x0107> <srezic@cpan.org>.
Based on L<Pod::Perldoc::ToText> which is by Sean M. Burke
<sburke@cpan.org> and Adriano R. Ferreira <ferreira@cpan.org>.
=cut
24 changes: 24 additions & 0 deletions t/00-basic.t
@@ -0,0 +1,24 @@
#!/usr/bin/perl -w
# -*- perl -*-

#
# $Id: 00-basic.t,v 1.11 2008/09/23 19:26:00 eserte Exp $
# Author: Slaven Rezic
#

use strict;

BEGIN {
if (!eval q{
use Test::More;
1;
}) {
print "1..0 # skip: no Test::More module\n";
exit;
}
}

plan tests => 2;

use_ok 'Pod::Perldoc::ToTextTermcap';
use_ok 'Pod::Perldoc::ToTextOverstrike';

0 comments on commit 5a7e5d9

Please sign in to comment.