Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Operators are routines
This gets as far as generating the index files, but dies trying to hack
together the urls for the operators. On a positive note, some of the
steps involved to make this work are also steps toward generalizing the
documentation of types, routines, etc.
  • Loading branch information
Mouq committed Jun 16, 2014
1 parent 4494168 commit ff624ef
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions htmlify.p6
Expand Up @@ -180,7 +180,6 @@ sub MAIN(Bool :$debug, Bool :$typegraph = False) {

write-disambiguation-files($dr);
write-op-disambiguation-files($dr);
write-operator-files($dr);
write-type-graph-images(:force($typegraph));
write-search-file($dr);
write-index-files($dr);
Expand Down Expand Up @@ -210,7 +209,7 @@ sub write-language-file(:$dr, :$what, :$pod, :$podname) {
my $what = ~$/;
my $operator = $heading.split(' ', 2)[1];
$dr.add-new(
:kind<operator>,
:kind<routine>,
:subkinds($what),
:name($operator),
:pod($chunk),
Expand Down Expand Up @@ -516,9 +515,6 @@ sub write-search-file($dr) {
qq[\{ label: "{ $subkind.tclc }: {escape .name}", value: "{escape .name}", url: "{ fix-url(.url) }" \}]
}
});
@items.push: $dr.lookup('operator', :by<kind>).map({
qq[\{ label: "$_.human-kind() {escape .name}", value: "{escape .name}", url: "{ fix-url .url }"\}]
});

my $items = @items.join(",\n");
spurt("html/js/search.js", $template.subst("ITEMS", $items));
Expand Down Expand Up @@ -618,23 +614,6 @@ sub write-op-disambiguation-files($dr) {

}

sub write-operator-files($dr) {
say 'Writing operator files ...';
for $dr.lookup('operator', :by<kind>).list -> $doc {
my $what = $doc.subkinds;
my $op = $doc.name;
my $pod = pod-with-title(
"$what.tclc() $op operator",
pod-block(
"Documentation for $what $op, extracted from ",
pod-link("the operators language documentation", "/language/operators")
),
@($doc.pod),
);
spurt "html/op/$what/$op.html", p2h($pod, $what);
}
}

sub write-index-files($dr) {
# XXX: Main index file can't be generated properly until
# it is turned into a Pod file. For now, it's just static.
Expand Down

0 comments on commit ff624ef

Please sign in to comment.