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   2740 use strict;
  1         2  
  1         24  
10 1     1   5 use warnings;
  1         1  
  1         46  
11              
12             package Pod::Perldoc::ToMarkdown;
13             our $AUTHORITY = 'cpan:RWSTAUNER';
14             $Pod::Perldoc::ToMarkdown::VERSION = '3.200';
15             # ABSTRACT: Enable `perldoc -o Markdown`
16              
17 1     1   4 use parent qw(Pod::Markdown);
  1         2  
  1         6  
18              
19             sub new {
20 1     1 1 2 my $class = shift;
21 1         9 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         2 return $self;
29             }
30              
31             sub parse_from_file {
32 1     1 1 1008 my $self = shift;
33             # Instantiate if called as a class method.
34 1 50       6 $self = $self->new if !ref $self;
35              
36             # Skip over SUPER's override and go up to grandpa's method.
37 1         4 $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__
49              
50             =pod
51              
52             =encoding UTF-8
53              
54             =for :stopwords Marcel Gruenauer Victor Moral Ryan C. Thompson <rct at thompsonclan d0t
55             org> Aristotle Pagaltzis Randy Stauner ACKNOWLEDGEMENTS
56              
57             =head1 NAME
58              
59             Pod::Perldoc::ToMarkdown - Enable `perldoc -o Markdown`
60              
61             =head1 VERSION
62              
63             version 3.200
64              
65             =for test_synopsis 1;
66             __END__
67              
68             =head1 SYNOPSIS
69              
70             perldoc -o Markdown Some::Module
71              
72             =head1 DESCRIPTION
73              
74             Pod::Perldoc expects a Pod::Parser compatible module,
75             however Pod::Markdown did not historically provide an entirely Pod::Parser
76             compatible interface.
77              
78             This module bridges the gap.
79              
80             =head1 AUTHORS
81              
82             =over 4
83              
84             =item *
85              
86             Marcel Gruenauer <marcel@cpan.org>
87              
88             =item *
89              
90             Victor Moral <victor@taquiones.net>
91              
92             =item *
93              
94             Ryan C. Thompson <rct at thompsonclan d0t org>
95              
96             =item *
97              
98             Aristotle Pagaltzis <pagaltzis@gmx.de>
99              
100             =item *
101              
102             Randy Stauner <rwstauner@cpan.org>
103              
104             =back
105              
106             =head1 COPYRIGHT AND LICENSE
107              
108             This software is copyright (c) 2011 by Randy Stauner.
109              
110             This is free software; you can redistribute it and/or modify it under
111             the same terms as the Perl 5 programming language system itself.
112              
113             =cut