Skip to content

Commit b618194

Browse files
committed
[htmlify] add footers
1 parent 53e37a8 commit b618194

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

htmlify.pl

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
my %types;
2323
my %routines;
2424
my %methods-by-type;
25+
my $footer;
2526

2627
sub pod-gist(Pod::Block $pod, $level = 0) {
2728
my $leading = ' ' x $level;
@@ -79,6 +80,9 @@ ($out_dir = 'html', Bool :$debug)
7980
}
8081
say "... done";
8182

83+
$footer = footer-html;
84+
85+
8286
for (@source) {
8387
my $podname = .key;
8488
my $file = .value;
@@ -88,7 +92,7 @@ ($out_dir = 'html', Bool :$debug)
8892
%types{$what}{$podname} = "/$what/$podname";
8993
my $pod = eval slurp($file.path) ~ "\n\$=pod";
9094
if $what eq 'language' {
91-
spurt "$out_dir/$what/$podname.html", pod2html($pod, :url(&url-munge));
95+
spurt "$out_dir/$what/$podname.html", pod2html($pod, :url(&url-munge), :$footer);
9296
next;
9397
}
9498
$pod = $pod[0];
@@ -129,7 +133,7 @@ ($out_dir = 'html', Bool :$debug)
129133
;
130134
}
131135
}
132-
spurt "$out_dir/$what/$podname.html", pod2html($pod, :url(&url-munge));
136+
spurt "$out_dir/$what/$podname.html", pod2html($pod, :url(&url-munge), :$footer);
133137
}
134138
write-search-file(:$out_dir);
135139
write-index-file(:$out_dir);
@@ -244,7 +248,7 @@ ($out_dir = 'html', Bool :$debug)
244248
}),
245249
);
246250
my $file = open :w, "$out_dir/index.html";
247-
$file.print: pod2html($pod, :url(&url-munge));
251+
$file.print: pod2html($pod, :url(&url-munge), :$footer);
248252
$file.close;
249253
}
250254

@@ -260,6 +264,21 @@ ($out_dir = 'html', Bool :$debug)
260264
})
261265
);
262266
my $file = open :w, "$out_dir/routine/$name.html";
263-
$file.print: pod2html($pod, :url(&url-munge));
267+
$file.print: pod2html($pod, :url(&url-munge), :$footer);
264268
$file.close;
265-
}
269+
}
270+
271+
sub footer-html() {
272+
qq[
273+
<div id="footer">
274+
<p>
275+
Generated on {DateTime.now} from the sources at
276+
<a href="https://github.com/perl6/doc">perl6/doc on github</a>.
277+
</p>
278+
<p>
279+
This is a work in progress to document Perl 6, and known to be
280+
incomplete. Your contribution is appreciated.
281+
</p>
282+
</div>
283+
];
284+
}

0 commit comments

Comments
 (0)