Skip to content

Commit ba845d4

Browse files
committed
Extract source code reference pod into own routine
1 parent 6344083 commit ba845d4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

htmlify.pl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,20 @@
8888
pod-code(@contents),
8989
));
9090
}
91-
$pod.push: pod-block("Source code: ",
92-
pod-link($file.basename, "https://github.com/perl6/perl6-examples/blob/master/categories/$category/" ~ $file.basename),
93-
);
91+
$pod.push: source-reference($file, $category);
9492
my $html-file = $file.subst(/\.p(l|6)/, ".html");
9593
spurt "html/$html-file", p2h($pod);
9694
}
9795
}
9896
}
9997

98+
sub source-reference($file, $category) {
99+
pod-block("Source code: ",
100+
pod-link($file.basename,
101+
"https://github.com/perl6/perl6-examples/blob/master/categories/$category/" ~ $file.basename),
102+
);
103+
}
104+
100105
sub p2h($pod) {
101106
pod2html $pod,
102107
:url(&url),

0 commit comments

Comments
 (0)