Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:perl6/doc
  • Loading branch information
Paul Cochrane committed Mar 11, 2015
2 parents b02b36f + 197d042 commit 4903f5c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions htmlify.p6
Expand Up @@ -32,7 +32,7 @@ use Pod::Htmlify;
my $*DEBUG = False;

my $type-graph;
my %methods-by-type;
my %routines-by-type;
my %*POD2HTML-CALLBACKS;

# TODO: Generate menulist automatically
Expand Down Expand Up @@ -263,32 +263,32 @@ multi write-type-source($doc) {
my @roles-todo = $type.roles;
my %roles-seen;
while @roles-todo.shift -> $role {
next unless %methods-by-type{$role};
next unless %routines-by-type{$role};
next if %roles-seen{$role}++;
@roles-todo.push: $role.roles;
$pod.contents.push:
pod-heading("Methods supplied by role $role"),
pod-heading("Routines supplied by role $role"),
pod-block(
"$podname does role ",
pod-link($role.name, "/type/{uri_escape ~$role}"),
", which provides the following methods:",
),
%methods-by-type{$role}.list,
%routines-by-type{$role}.list,
;
}
for @mro -> $class {
next unless %methods-by-type{$class};
next unless %routines-by-type{$class};
$pod.contents.push:
pod-heading("Methods supplied by class $class"),
pod-heading("Routines supplied by class $class"),
pod-block(
"$podname inherits from class ",
pod-link($class.name, "/type/{uri_escape ~$class}"),
", which provides the following methods:",
),
%methods-by-type{$class}.list,
%routines-by-type{$class}.list,
;
for $class.roles -> $role {
next unless %methods-by-type{$role};
next unless %routines-by-type{$role};
$pod.contents.push:
pod-heading("Methods supplied by role $role"),
pod-block(
Expand All @@ -298,7 +298,7 @@ multi write-type-source($doc) {
pod-link($role.name, "/type/{uri_escape ~$role}"),
", which provides the following methods:",
),
%methods-by-type{$role}.list,
%routines-by-type{$role}.list,
;
}
}
Expand Down Expand Up @@ -444,8 +444,8 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1) {
$created.subkinds = @subkinds;
$created.categories = @subkinds;
}
if $subkinds 'method' {
%methods-by-type{$origin.name}.push: $chunk;
if %attr<kind> eq 'routine' {
%routines-by-type{$origin.name}.push: $chunk;
write-qualified-method-call(
:$name,
:pod($chunk),
Expand Down Expand Up @@ -698,6 +698,7 @@ sub write-qualified-method-call(:$name!, :$pod!, :$type!) {
pod-block('From ', pod-link($type, "/type/{$type}#$name")),
@$pod,
);
return if $name ~~ / '/' /;
spurt "html/routine/{$type}.{$name}.html", p2h($p, 'routine');
}

Expand Down

0 comments on commit 4903f5c

Please sign in to comment.