Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[htmlify] write disambiguation files

for example http://doc.perl6.org/Str now says it is a type and a method
  • Loading branch information...
commit 3d6fb615b0469bac6bf676c6ee11df99163e0e03 1 parent 73e7393
@moritz moritz authored
Showing with 25 additions and 3 deletions.
  1. +25 −3 htmlify.pl
View
28 htmlify.pl
@@ -167,6 +167,7 @@ (Bool :$debug, Bool :$typegraph = False)
spurt "html/$what/$podname.html", pod2html($pod, :url(&url-munge), :$footer);
}
+ write-disambiguation-files();
write-type-graph-images(:force($typegraph));
write-search-file();
write-index-file();
@@ -176,7 +177,6 @@ (Bool :$debug, Bool :$typegraph = False)
%routines.delete($name);
}
say "done writing per-routine files";
- # TODO: write top-level disambiguation files
}
sub chunks-grep(:$from!, :&to!, *@elems) {
@@ -244,8 +244,6 @@ (Bool :$debug, Bool :$typegraph = False)
sub write-type-graph-images(:$force) {
unless $force {
my $dest = 'html/images/type-graph-Any.svg'.path;
- say "cwd: ", cwd;
- say 'type-graph.txt'.path.e;
if $dest.e && $dest.modified >= 'type-graph.txt'.path.modified {
say "Not writing type graph images, it seems to be up-to-date";
say "To force writing of type graph images, supply the --typegraph";
@@ -335,6 +333,30 @@ (Bool :$debug, Bool :$typegraph = False)
spurt("html/search.html", $template.subst("ITEMS", $items));
}
+sub write-disambiguation-files() {
+ say "Writing disambiguation files";
+ for %names.kv -> $name, %w {
+ print '.';
+ my $pod = pod-with-title("Disambiguation file for '$name'");
+ if %w == 1 {
+ my ($what, $url) = %w.kv;
+ $pod.content.push:
+ pod-block(
+ pod-link("'$name' is a $what", "/$what/$name")
+ );
+ }
+ else {
+ $pod.content.push:
+ pod-block("'$name' can be anything of the following"),
+ %w.pairs.map({
+ pod-item( pod-link(.key, "/{.key}/$name") )
+ });
+ }
+ spurt "html/$name.html", pod2html($pod, :url(&url-munge), :$footer);
+ }
+ say "... done writing disambiguation files";
+}
+
sub write-index-file() {
say "Writing html/index.html";
my $pod = pod-with-title('Perl 6 Documentation',
Please sign in to comment.
Something went wrong with that request. Please try again.