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