Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #409 from azawawi/master
Fix #334
  • Loading branch information
azawawi committed Mar 4, 2016
2 parents 7b7d42d + 8384e5a commit e0099d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ html/syntax/
html/images/type-graph*
html/js/search.js
.precomp
precompiled
21 changes: 17 additions & 4 deletions htmlify.p6
Expand Up @@ -156,9 +156,22 @@ sub MAIN(
}
}

sub extract-pod($file) {
use MONKEY-SEE-NO-EVAL;
my $pod = EVAL(slurp($file.path) ~ "\n\$=pod")[0];
my $precomp-store = CompUnit::PrecompilationStore::File.new(:prefix($?FILE.IO.parent.child("precompiled")));
my $precomp = CompUnit::PrecompilationRepository::Default.new(store => $precomp-store);

sub extract-pod(IO() $file) {
use nqp;
# The file name is enough for the id because POD files don't have depends
my $id = nqp::sha1(~$file);
my $handle = $precomp.load($id,:since($file.modified));

if not $handle {
# precomile it
$precomp.precompile($file, $id);
$handle = $precomp.load($id);
}

return nqp::atkey($handle.unit,'$=pod')[0];
}

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

0 comments on commit e0099d0

Please sign in to comment.