Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename $tg -> $type-graph in htmlify
  • Loading branch information
Paul Cochrane committed Feb 14, 2015
1 parent 1139ae9 commit 622daaa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions htmlify.p6
Expand Up @@ -15,7 +15,7 @@ use Pod::Convenience;

my $*DEBUG = False;

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

Expand Down Expand Up @@ -128,8 +128,8 @@ sub MAIN(
my $*DR = Perl6::Documentable::Registry.new;

say 'Reading type graph ...';
$tg = Perl6::TypeGraph.new-from-file('type-graph.txt');
my %h = $tg.sorted.kv.flat.reverse;
$type-graph = Perl6::TypeGraph.new-from-file('type-graph.txt');
my %h = $type-graph.sorted.kv.flat.reverse;
write-type-graph-images(:force($typegraph));

process-pod-dir 'Language', :$sparse;
Expand Down Expand Up @@ -206,7 +206,7 @@ sub process-pod-source(:$kind, :$pod, :$filename, :$pod-is-complete) {

my %type-info;
if $kind eq "type" {
if $tg.types{$name} -> $type {
if $type-graph.types{$name} -> $type {
%type-info = :subkinds($type.packagetype), :categories($type.categories);
} else {
%type-info = :subkinds<class>;
Expand All @@ -230,7 +230,7 @@ sub process-pod-source(:$kind, :$pod, :$filename, :$pod-is-complete) {
multi write-type-source($doc) {
my $pod = $doc.pod;
my $podname = $doc.name;
my $type = $tg.types{$podname};
my $type = $type-graph.types{$podname};
my $what = 'type';

say "Writing $what document for $podname ...";
Expand Down Expand Up @@ -373,7 +373,7 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1) {
note "$name does not have an =SUBTITLE";
}
%attr = :kind<type>,
:categories($tg.types{$name}.?categories//''),
:categories($type-graph.types{$name}.?categories//''),
:$summary,
}
when 'variable'|'sigil'|'twigil'|'declarator'|'quote' {
Expand Down Expand Up @@ -458,7 +458,7 @@ sub write-type-graph-images(:$force) {
}
}
say 'Writing type graph images to html/images/ ...';
for $tg.sorted -> $type {
for $type-graph.sorted -> $type {
my $viz = Perl6::TypeGraph::Viz.new-for-type($type);
$viz.to-file("html/images/type-graph-{$type}.svg", format => 'svg');
$viz.to-file("html/images/type-graph-{$type}.png", format => 'png', size => '8,3');
Expand All @@ -467,9 +467,9 @@ sub write-type-graph-images(:$force) {
say '';

say 'Writing specialized visualizations to html/images/ ...';
my %by-group = $tg.sorted.classify(&viz-group);
%by-group<Exception>.push: $tg.types< Exception Any Mu >;
%by-group<Metamodel>.push: $tg.types< Any Mu >;
my %by-group = $type-graph.sorted.classify(&viz-group);
%by-group<Exception>.push: $type-graph.types< Exception Any Mu >;
%by-group<Metamodel>.push: $type-graph.types< Any Mu >;

for %by-group.kv -> $group, @types {
my $viz = Perl6::TypeGraph::Viz.new(:types(@types),
Expand Down

0 comments on commit 622daaa

Please sign in to comment.