Skip to content

Commit 0562a79

Browse files
committed
Format author heading
1 parent 10a3dd7 commit 0562a79

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

htmlify.pl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,26 @@
122122
my @filenames = @files.map: {.basename};
123123
for @files -> $file {
124124
next unless $file.IO.e;
125-
my $pod = %examples{$category}{""}{$file}.pod-contents;
125+
my $example = %examples{$category}{""}{$file};
126+
my $pod = format-author-heading($example);
126127
$pod.push: source-reference($file, $category);
127128
my $html-file = $file.subst(/\.p(l|6)/, ".html");
128129
spurt "html/$html-file", p2h($pod);
129130
}
130131
}
131132
}
132133

134+
sub format-author-heading($example) {
135+
my $pod = $example.pod-contents;
136+
if $example.author {
137+
my $author-heading = Pod::FormattingCode.new(:type<I>,
138+
contents => ["Author: " ~ $example.author]);
139+
$example.pod-contents[0].contents[1] = pod-block([$author-heading]);
140+
}
141+
142+
return $pod;
143+
}
144+
133145
sub pod-title-contents($pod, $file) {
134146
my $title-element = $pod[0].contents[0];
135147
my $title;

0 commit comments

Comments
 (0)