Skip to content
Browse files

add operators to search

  • Loading branch information...
1 parent cbcc0dd commit 03a13a19182a3ceee4b672938e6245a64dce215a @moritz moritz committed Aug 15, 2012
Showing with 7 additions and 1 deletion.
  1. +6 −0 htmlify.pl
  2. +1 −1 lib/Perl6/Documentable.pm
View
6 htmlify.pl
@@ -399,6 +399,12 @@ (Bool :$debug, Bool :$typegraph = False)
@items.push: $dr.lookup('routine', :by<kind>).grep({!%seen{.name}++}).sort(*.name).map({
"\{ label: \"{ (.subkind // 'Routine').tclc }: {.name}\", value: \"{.name}\", url: \"{ fix-url(.url) }\" \}"
});
+ sub escape(Str $s) {
+ $s.trans([</ \\ ">] => [<\\/ \\\\ \\">]);
+ }
+ @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/search.html", $template.subst("ITEMS", $items));
View
2 lib/Perl6/Documentable.pm
@@ -26,7 +26,7 @@ class Perl6::Documentable {
}
method url() {
$.kind eq 'operator'
- ?? "/language/operator#$.subkind%20" ~ uri_escape($.name)
+ ?? "/language/operators#$.subkind%20" ~ uri_escape($.name)
!! "/$.kind/$.name"
;
}

0 comments on commit 03a13a1

Please sign in to comment.
Something went wrong with that request. Please try again.