Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

index the X<> tags as well and display the whole section. Use as p6do…

…c '$_' and p6doc '$*OS'
  • Loading branch information...
commit da6549716937d2e3c93281963fd9a11b68139ef4 1 parent 3b8af6d
@szabgab szabgab authored
Showing with 14 additions and 7 deletions.
  1. +6 −3 bin/p6doc
  2. +8 −4 index.pl
View
9 bin/p6doc
@@ -71,9 +71,12 @@ multi sub MAIN() {
multi sub MAIN($docee) {
return MAIN($docee, :f) if defined $docee.index('.') ;
if 'index.data'.IO ~~ :e {
- my %data = eval slurp 'index.data';
- return MAIN(%data{$docee} ~ ".$docee", :f) if %data{$docee};
- }
+ my %data = eval slurp 'index.data';
+ if %data{$docee} {
+ my $newdoc = %data{$docee}[0][0] ~ "." ~ %data{$docee}[0][1];
+ return MAIN($newdoc, :f);
+ }
+ }
show-docs(locate-module($docee));
}
View
12 index.pl
@@ -5,14 +5,18 @@ ()
my $outfile = "index.ini";
my %words;
for dir('lib') -> $file {
+ my $pod = substr($file.Str, 0 , $file.Str.chars -4);
next if $file !~~ /\.pod$/;
- #say $file.Str;
+ my $section = '';
for open('lib/' ~ $file.Str).lines -> $row {
#if $row ~~ /^\=(item|head\d) \s+ X\<(.*)\> \s*$/ {
if $row ~~ /^\=(item|head\d) \s+ (.*?) \s*$/ {
- my $w = $1.Str;
- %words{$w}.push(substr($file.Str, 0 , $file.Str.chars -4));
- #say ' ', $1.Str;
+ $section = $1.Str;
+ %words{$section}.push([$pod, $section]);
+ }
+ if $row ~~ /X\<(.*?)\>/ and $section {
+ my $x = $0.Str;
+ %words{$x}.push([$pod, $section]);
}
}
}

0 comments on commit da65497

Please sign in to comment.
Something went wrong with that request. Please try again.