Skip to content

Commit f297b42

Browse files
committed
simplify some code
1 parent 8fa2a48 commit f297b42

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

htmlify.pl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ (Bool :$debug, Bool :$typegraph = False)
102102
my $pod = eval slurp($file.path) ~ "\n\$=pod";
103103
$pod.=[0];
104104
if $what eq 'language' {
105-
spurt "html/$what/$podname.html", pod2html($pod, :url(&url-munge), :$footer);
105+
spurt "html/$what/$podname.html", p2h($pod);
106106
if $podname eq 'operators' {
107107
my @chunks = chunks-grep($pod.content,
108108
:from({ $_ ~~ Pod::Heading and .level == 2}),
@@ -438,9 +438,7 @@ (Bool :$debug, Bool :$typegraph = False)
438438
pod-item(pod-link(.key, .value))
439439
}),
440440
);
441-
my $file = open :w, "html/index.html";
442-
$file.print: pod2html($pod, :url(&url-munge), :$footer);
443-
$file.close;
441+
spurt 'html/index.html', p2h($pod);
444442
}
445443

446444
sub write-routine-file(:$name!, :@chunks!) {
@@ -454,9 +452,7 @@ (Bool :$debug, Bool :$typegraph = False)
454452
@$chunk
455453
})
456454
);
457-
my $file = open :w, "html/routine/$name.html";
458-
$file.print: pod2html($pod, :url(&url-munge), :$footer);
459-
$file.close;
455+
spurt "html/routine/$name.html", p2h($pod);
460456
}
461457

462458
sub footer-html() {

0 commit comments

Comments
 (0)