Skip to content

Commit

Permalink
method, method, method, method, method
Browse files Browse the repository at this point in the history
This commit resolves the problem when “method” is repeated 20 times
needlessly. It was assumed that .unique is going to do the trick, but
in reality it's an array of 1-element arrays, so we have to slip it.

There was a ticket for that issue but I can't find it.
  • Loading branch information
AlexDaniel committed Nov 4, 2017
1 parent 390459d commit c3a93a5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions htmlify.p6
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ sub write-sub-index(:$kind, :$category, :&summary = {Nil}) {
.grep({$category .categories})\ # XXX
.categorize(*.name).sort(*.key)>>.value
.map({[
.map({.subkinds // Nil}).unique.join(', '),
.map({slip .subkinds // Nil}).unique.join(', '),
pod-link(.[0].name, .[0].url),
.&summary
]})
Expand All @@ -893,10 +893,8 @@ sub write-kind($kind) {
$*DR.lookup($kind, :by<kind>)
.categorize({.name})
.kv.map: -> $name, @docs {
my @subkinds = @docs.map({.subkinds}).unique;
my $subkind = @subkinds.squish(with => &infix:<~~>) == 1
?? @subkinds.list[0]
!! $kind;
my @subkinds = @docs.map({slip .subkinds}).unique;
my $subkind = @subkinds == 1 ?? @subkinds[0] !! $kind;
my $pod = pod-with-title(
"$subkind $name",
pod-block("Documentation for $subkind $name, assembled from the following types:"),
Expand Down

0 comments on commit c3a93a5

Please sign in to comment.