diff --git a/MANIFEST b/MANIFEST index efabaca..7895418 100644 --- a/MANIFEST +++ b/MANIFEST @@ -30,6 +30,7 @@ t/04_targets/02_synopsis.t t/04_targets/03_function.t t/04_targets/04_table.t t/04_targets/05_failure.t +t/04_targets/06_man_page.t t_source/basic.pod t_source/basic5.pod xt/perlcriticrc diff --git a/Makefile.PL b/Makefile.PL index f8ab989..516e04a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,7 +17,7 @@ requires ('Getopt::Long' => '2.33'); requires ('IO::Interactive' => '0'); requires ('File::ShareDir' => '0'); requires ('File::Temp' => '0'); -requires ('Perl6::Doc' => '0.41'); +requires ('Perl6::Doc' => '0.42'); requires ('Perl6::Perldoc' => '0.0.5'); requires ('Perl6::Perldoc::To::Ansi' => '0.07'); requires ('Pod::Text::Ansi' => '0.03'); diff --git a/lib/App/Grok/Resource/Spec.pm b/lib/App/Grok/Resource/Spec.pm index 3452382..a8d80d3 100644 --- a/lib/App/Grok/Resource/Spec.pm +++ b/lib/App/Grok/Resource/Spec.pm @@ -18,7 +18,6 @@ my %docs = map { sub spec_fetch { my ($topic) = @_; - return if $topic !~ /^\w\d\d/; _build_index() if !%index; for my $doc (keys %index) { @@ -57,6 +56,14 @@ sub _build_index { } } + # man pages (perlintro, etc) + my $pages_dir = catdir($dist_dir, 'man_pages'); + for my $file (glob "$pages_dir/*.pod") { + my $name = (splitpath($file))[2]; + $name =~ s/\.pod$//; + $index{$name} = $file; + } + # synopsis 32 my $S32_dir = catdir($docs{S}, 'S32-setting-library'); for my $file (glob "$S32_dir/*.pod") { @@ -94,6 +101,8 @@ App::Grok::Resource::Spec - Perl 6 specification resource for grok This module the locates Apocalypses, Exegeses, Synopsis and magazine articles distributed with L. +It also includes user documentation like F and F. + =head1 METHODS =head2 C diff --git a/t/04_targets/06_man_page.t b/t/04_targets/06_man_page.t new file mode 100644 index 0000000..a0c08c1 --- /dev/null +++ b/t/04_targets/06_man_page.t @@ -0,0 +1,12 @@ +use strict; +use warnings; +use File::Spec::Functions 'catfile'; +use Test::More tests => 2; + +my $grok = catfile('script', 'grok'); + +my $perlintro = qx/$^X $grok perlintro/; +my $perlsyn = qx/$^X $grok perlsyn/; + +like($perlintro, qr/A brief introduction and overview of Perl 6/, 'Got perlintro'); +like($perlsyn, qr/Perl syntax/, 'Got perlsyn');