Skip to content

Commit 2141eca

Browse files
committed
Now we take predefined search values from outer file
1 parent 7fd6934 commit 2141eca

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

htmlify.p6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ sub write-search-file() {
757757
$_, $url
758758
);
759759
});
760-
spurt("html/js/search.js", $template.subst("ITEMS", @items.join(",\n") ).subst("WARNING", "DO NOT EDIT generated by $?FILE:$?LINE"));
760+
spurt("html/js/search.js", $template.subst("ITEMS", @items.join(",\n") ).subst("WARNING", "DO NOT EDIT generated by $?FILE:$?LINE").subst("PREDEFINED", slurp("predefined-search-items")));
761761
}
762762

763763
sub write-disambiguation-files() {

predefined-search-items

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ category: "Syntax", value: "# sinle-line comment", url: "/language/syntax#Single-line_comments" },
2+
{ category: "Syntax", value: "#` multi-line comment", url: "/language/syntax#Multi-line_/_embedded_comments" },

template/search_template.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ $(function(){
5555
},
5656
position: { my: "right top", at: "right bottom", of: "#search div" },
5757
source: [
58-
{ category: "Syntax", value: "# sinle-line comment", url: "/language/syntax#Single-line_comments" },
59-
{ category: "Syntax", value: "#` multi-line comment", url: "/language/syntax#Multi-line_/_embedded_comments" },
60-
ITEMS
58+
PREDEFINED
59+
ITEMS
6160
],
6261
select: function (event, ui) { window.location.href = ui.item.url; },
6362
autoFocus: true

0 commit comments

Comments
 (0)