File Coverage

blib/lib/Pod/Perldoc/ToMarkdown.pm
Criterion Covered Total %
statement 15 15 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 23 24 95.8


line stmt bran cond sub pod time code
1             #
2             # This file is part of Pod-Markdown
3             #
4             # This software is copyright (c) 2011 by Randy Stauner.
5             #
6             # This is free software; you can redistribute it and/or modify it under
7             # the same terms as the Perl 5 programming language system itself.
8             #
9 1     1   3650 use strict;
  1         3  
  1         31  
10 1     1   6 use warnings;
  1         2  
  1         58  
11              
12             package Pod::Perldoc::ToMarkdown;
13             our $AUTHORITY = 'cpan:RWSTAUNER';
14             $Pod::Perldoc::ToMarkdown::VERSION = '3.300';
15             # ABSTRACT: Enable `perldoc -o Markdown`
16              
17 1     1   5 use parent qw(Pod::Markdown);
  1         2  
  1         8  
18              
19             sub new {
20 1     1 1 2 my $class = shift;
21 1         11 my $self = $class->SUPER::new(
22             # Pod::Perldoc does not pass any options by default
23             # but will call setters if attributes are passed on command line.
24             # I don't know what encoding it expects, but it needs one, so default to UTF-8.
25             output_encoding => 'UTF-8',
26             @_,
27             );
28 1         3 return $self;
29             }
30              
31             sub parse_from_file {
32 1     1 1 965 my $self = shift;
33             # Instantiate if called as a class method.
34 1 50       8 $self = $self->new if !ref $self;
35              
36             # Skip over SUPER's override and go up to grandpa's method.
37 1         7 $self->Pod::Simple::parse_from_file(@_);
38             }
39              
40             # There are several other methods that we could implement that Pod::Perldoc
41             # finds interesting:
42             # * output_is_binary
43             # * name
44             # * output_extension
45              
46             1;
47              
48             __END__