File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -519,12 +519,13 @@ sub write-search-file () {
519
519
sub escape (Str $ s ) {
520
520
$ s . trans ([</ \\ " >] => [<\\ / \\\\ \\ " > ]);
521
521
}
522
- my $ items = <language type routine syntax >. map ({
523
- $ * DR . lookup($ _ , : by<kind >). unique (: as{. name }). sort ({. name })
524
- }). flat . map ({
525
- . subkinds. map : -> $ subkind {
526
- qq [ \{ label: "{ $ subkind . wordcase} : { escape . name } ", value: "{ escape . name } ", url: "{ . url} " \} ]
527
- }
522
+ my $ items = <language type routine syntax >. map (-> $ kind {
523
+ $ * DR . lookup($ kind , : by<kind >). categorize ({escape . name })\
524
+ . pairs . sort ({. key }). map : -> (: key($ name ), : value(@ docs )) {
525
+ qq [[ \{ label: "{
526
+ ( @ docs > 1 ?? $ kind !! @ docs . [0 ]. subkinds[0 ] ). wordcase
527
+ } : $ name ", value: "$ name ", url: "{ @ docs . [0 ]. url} " \} ]] # "
528
+ }
528
529
}). join (" ,\n " );
529
530
spurt (" html/js/search.js" , $ template . subst (" ITEMS" , $ items ));
530
531
}
You can’t perform that action at this time.
0 commit comments