Skip to content

Commit

Permalink
make Makefile.PL write README and README.md
Browse files Browse the repository at this point in the history
If the necessary modules are present, create README and README.md from the POD.
  • Loading branch information
cowens authored and wchristian committed Nov 1, 2014
1 parent 2c2a7d6 commit dcc718c
Show file tree
Hide file tree
Showing 2 changed files with 810 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@ use warnings;

use inc::Module::Install 1.10;

# only needed by author to run 'perl Makefile.PL'
# use Module::Install::ReadmeFromPod 0.22;

all_from 'lib/PPI.pm';
readme_from 'lib/PPI.pm'; # Module::Install::ReadmeFromPod

# This code is only needed by author to generate README and README.md
eval {
eval "use Module::Install::ReadmeFromPod 0.22";
eval "use Pod::Markdown 2.002";

my $pod = 'lib/PPI.pm';
readme_from $pod; # Module::Install::ReadmeFromPod

my $parser = Pod::Markdown->new;
open my $in, "<", $pod;
open my $out, ">", "README.md";
if ($parser and $in and $out) {
$parser->parse_from_filehandle($in);
print $out $parser->as_markdown;
}
};

requires 'Clone' => '0.30';
requires 'File::Spec' => win32() ? '3.2701' : '0.84';
Expand Down
Loading

0 comments on commit dcc718c

Please sign in to comment.