Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Write out routine sub-indices
  • Loading branch information
Mouq committed Jun 16, 2014
1 parent 57ef3c5 commit d7a28e7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions htmlify.p6
Expand Up @@ -655,7 +655,7 @@ sub write-index-files($dr) {
"Use the above menu to narrow it down topically."
}

sub main-index($kind) {
sub write-main-index($kind) {
say "Writing html/$kind.html ...";
spurt "html/$kind.html", p2h(pod-with-title(
"Perl 6 {$kind.tc}s",
Expand All @@ -666,7 +666,19 @@ sub write-index-files($dr) {
), $kind);
}

.&main-index for <type routine>;
# XXX: Only handles normal routines, not types nor operators
sub write-sub-index($kind, $subkind) {
say "Writing html/$kind-$subkind.html ...";
spurt "html/$kind-$subkind.html", p2h(pod-with-title(
"Perl 6 {$subkind.tc} {$kind.tc}s",
pod-table($dr.lookup($kind, :by<kind>).grep({$subkind .subkinds}).map({
[set(.map: {.subkinds // Nil}).list.join(', '), pod-link(.name, .url), .summary]
}))
), $kind);
}

.&write-main-index for <type routine>;
write-sub-index 'routine', $_ for <sub method term>;
}

sub write-routine-file($dr, $name) {
Expand Down

0 comments on commit d7a28e7

Please sign in to comment.