Skip to content
Newer
Older
100755 28 lines (25 sloc) 630 Bytes
af090f6 @szabgab indexing =head and =item elements and allowing the user to type "p6do…
szabgab authored Jul 5, 2012
1 #!/usr/bin/env perl6
2 use v6;
3
4 sub MAIN() {
5 my $outfile = "index.ini";
6 my %words;
7 for dir('lib') -> $file {
da65497 @szabgab index the X<> tags as well and display the whole section. Use as p6do…
szabgab authored Jul 5, 2012
8 my $pod = substr($file.Str, 0 , $file.Str.chars -4);
af090f6 @szabgab indexing =head and =item elements and allowing the user to type "p6do…
szabgab authored Jul 5, 2012
9 next if $file !~~ /\.pod$/;
da65497 @szabgab index the X<> tags as well and display the whole section. Use as p6do…
szabgab authored Jul 5, 2012
10 my $section = '';
af090f6 @szabgab indexing =head and =item elements and allowing the user to type "p6do…
szabgab authored Jul 5, 2012
11 for open('lib/' ~ $file.Str).lines -> $row {
12 #if $row ~~ /^\=(item|head\d) \s+ X\<(.*)\> \s*$/ {
13 if $row ~~ /^\=(item|head\d) \s+ (.*?) \s*$/ {
da65497 @szabgab index the X<> tags as well and display the whole section. Use as p6do…
szabgab authored Jul 5, 2012
14 $section = $1.Str;
15 %words{$section}.push([$pod, $section]);
16 }
17 if $row ~~ /X\<(.*?)\>/ and $section {
18 my $x = $0.Str;
19 %words{$x}.push([$pod, $section]);
af090f6 @szabgab indexing =head and =item elements and allowing the user to type "p6do…
szabgab authored Jul 5, 2012
20 }
21 }
22 }
23 my $out = open('index.data', :w);
24 $out.print(%words.perl);
25 $out.close;
26 }
27
Something went wrong with that request. Please try again.