@@ -156,9 +156,22 @@ sub MAIN(
156
156
}
157
157
}
158
158
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 ];
162
175
}
163
176
164
177
sub process-pod-dir ($ dir , : & sorted-by = &[cmp ], : $ sparse ) {
@@ -629,7 +642,7 @@ sub write-search-file () {
629
642
}
630
643
}). flat ;
631
644
@ items . append ( % p5to6-functions . keys . map ( {
632
- my $ url = " /language/5to6-perlfunc.html #" ~ uri_escape($ _ );
645
+ my $ url = " /language/5to6-perlfunc#" ~ uri_escape($ _ );
633
646
sprintf ( q [[ { category: "5to6-perlfunc", value: "%s", url: "%s" } ]] , $ _ , $ url );
634
647
}) );
635
648
spurt (" html/js/search.js" , $ template . subst (" ITEMS" , @ items . join (" ,\n " ) ));
0 commit comments