Skip to content

Commit e0099d0

Browse files
committed
Merge pull request #409 from azawawi/master
Fix #334
2 parents 7b7d42d + 8384e5a commit e0099d0

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ html/syntax/
1010
html/images/type-graph*
1111
html/js/search.js
1212
.precomp
13+
precompiled

htmlify.p6

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,22 @@ sub MAIN(
156156
}
157157
}
158158

159-
sub extract-pod($file) {
160-
use MONKEY-SEE-NO-EVAL;
161-
my $pod = EVAL(slurp($file.path) ~ "\n\$=pod")[0];
159+
my $precomp-store = CompUnit::PrecompilationStore::File.new(:prefix($?FILE.IO.parent.child("precompiled")));
160+
my $precomp = CompUnit::PrecompilationRepository::Default.new(store => $precomp-store);
161+
162+
sub extract-pod(IO() $file) {
163+
use nqp;
164+
# The file name is enough for the id because POD files don't have depends
165+
my $id = nqp::sha1(~$file);
166+
my $handle = $precomp.load($id,:since($file.modified));
167+
168+
if not $handle {
169+
# precomile it
170+
$precomp.precompile($file, $id);
171+
$handle = $precomp.load($id);
172+
}
173+
174+
return nqp::atkey($handle.unit,'$=pod')[0];
162175
}
163176

164177
sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse) {
@@ -629,7 +642,7 @@ sub write-search-file () {
629642
}
630643
}).flat;
631644
@items.append( %p5to6-functions.keys.map( {
632-
my $url = "/language/5to6-perlfunc.html#" ~ uri_escape($_);
645+
my $url = "/language/5to6-perlfunc#" ~ uri_escape($_);
633646
sprintf( q[[{ category: "5to6-perlfunc", value: "%s", url: "%s" }]], $_, $url);
634647
}) );
635648
spurt("html/js/search.js", $template.subst("ITEMS", @items.join(",\n") ));

0 commit comments

Comments
 (0)