1
1
# !/usr/bin/env perl6
2
2
use v6 ;
3
- use MONKEY-SEE-NO-EVAL ;
4
3
5
4
# This script isn't in bin/ because it's not meant to be installed.
6
5
# For syntax highlighting, needs pygmentize version 2.0 or newer installed
@@ -156,6 +155,11 @@ sub MAIN(
156
155
}
157
156
}
158
157
158
+ sub extract-pod ($ file ) {
159
+ use MONKEY-SEE-NO-EVAL ;
160
+ my $ pod = EVAL (slurp ($ file . path ) ~ " \n \$=pod" )[0 ];
161
+ }
162
+
159
163
sub process-pod-dir ($ dir , : & sorted-by = &[cmp ], : $ sparse ) {
160
164
say " Reading doc/$ dir ..." ;
161
165
my @ pod-sources =
@@ -176,7 +180,7 @@ sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse) {
176
180
my $ kind = $ dir . lc ;
177
181
for @ pod-sources . kv -> $ num , (: key($ filename ), : value($ file )) {
178
182
printf " % 4d/% d : % -40s => % s\n " , $ num + 1, $ total , $ file . path , " $ kind /$ filename" ;
179
- my $ pod = EVAL ( slurp ( $ file . path ) ~ " \n \$=pod " )[ 0 ] ;
183
+ my $ pod = extract-pod( $ file . path );
180
184
process-pod-source : $ kind , : $ pod , : $ filename , : pod-is-complete;
181
185
}
182
186
}
@@ -656,7 +660,7 @@ sub write-disambiguation-files () {
656
660
sub write-index-files () {
657
661
say ' Writing html/index.html ...' ;
658
662
spurt ' html/index.html' ,
659
- p2h(EVAL ( slurp ( ' doc/HomePage.pod' ) ~ " \n \$=pod " ),
663
+ p2h(extract-pod( ' doc/HomePage.pod' ),
660
664
pod-path => ' HomePage.pod' );
661
665
662
666
say ' Writing html/language.html ...' ;
0 commit comments