Skip to content

Commit 03a13a1

Browse files
committed
add operators to search
1 parent cbcc0dd commit 03a13a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

htmlify.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ (Bool :$debug, Bool :$typegraph = False)
399399
@items.push: $dr.lookup('routine', :by<kind>).grep({!%seen{.name}++}).sort(*.name).map({
400400
"\{ label: \"{ (.subkind // 'Routine').tclc }: {.name}\", value: \"{.name}\", url: \"{ fix-url(.url) }\" \}"
401401
});
402+
sub escape(Str $s) {
403+
$s.trans([</ \\ ">] => [<\\/ \\\\ \\">]);
404+
}
405+
@items.push: $dr.lookup('operator', :by<kind>).map({
406+
qq[\{ label: "$_.human-kind() {escape .name}", value: "{escape .name}", url: "{ fix-url .url }"\}]
407+
});
402408

403409
my $items = @items.join(",\n");
404410
spurt("html/search.html", $template.subst("ITEMS", $items));

lib/Perl6/Documentable.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Perl6::Documentable {
2626
}
2727
method url() {
2828
$.kind eq 'operator'
29-
?? "/language/operator#$.subkind%20" ~ uri_escape($.name)
29+
?? "/language/operators#$.subkind%20" ~ uri_escape($.name)
3030
!! "/$.kind/$.name"
3131
;
3232
}

0 commit comments

Comments
 (0)