Skip to content
This repository
branch: html-search
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 28 lines (25 sloc) 0.63 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/usr/bin/env perl6
use v6;

sub MAIN() {
my $outfile = "index.ini";
my %words;
for dir('lib') -> $file {
my $pod = substr($file.Str, 0 , $file.Str.chars -4);
next if $file !~~ /\.pod$/;
my $section = '';
for open('lib/' ~ $file.Str).lines -> $row {
#if $row ~~ /^\=(item|head\d) \s+ X\<(.*)\> \s*$/ {
if $row ~~ /^\=(item|head\d) \s+ (.*?) \s*$/ {
$section = $1.Str;
%words{$section}.push([$pod, $section]);
}
if $row ~~ /X\<(.*?)\>/ and $section {
my $x = $0.Str;
%words{$x}.push([$pod, $section]);
}
}
}
my $out = open('index.data', :w);
$out.print(%words.perl);
$out.close;
}

Something went wrong with that request. Please try again.