Skip to content

Commit

Permalink
Better search. #598. Thank you Zireael07 for the bug report.
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Oct 3, 2024
1 parent d146435 commit c5f7a3e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 37 deletions.
18 changes: 8 additions & 10 deletions Computer.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ table
git clone ${mainRepo}`
: ""

return `import ../header.scroll
return `../header.scroll
baseUrl https://pldb.io/concepts/
title ${title} - ${lodash.upperFirst(primaryTagName)}
Expand All @@ -779,7 +779,7 @@ printTitle ${title}
viewSourceUrl ${this.sourceUrl}
wideColumns 1
container 800px
<div class="trueBaseThemeQuickLinks">${this.quickLinks}</div>
Expand All @@ -799,7 +799,7 @@ ${this.descriptionSection}
${this.factsArray.map(fact => `- ${fact}\n inlineMarkupsOn none`).join("\n")}
<br>
br
${this.exampleSection}
Expand Down Expand Up @@ -1477,27 +1477,25 @@ class Feature {
const description = this.measure.Description
if (description) descriptionText = `* This question asks: ${description}`

return `import header.scroll
return `header.scroll
title ${title} - language feature
tags Feature
printTitle ${title}
html
<a class="trueBaseThemePreviousItem" href="${previous.permalink}">&lt;</a>
<a class="trueBaseThemeNextItem" href="${next.permalink}">&gt;</a>
<a class="trueBaseThemePreviousItem" href="${previous.permalink}">&lt;</a>
<a class="trueBaseThemeNextItem" href="${next.permalink}">&gt;</a>
viewSourceUrl https://github.com/breck7/pldb/blob/main/Computer.js
mediumColumns 1
container 600px
${examplesText}
***
${[positiveText, negativeText, descriptionText, explorerLinks, referencesText].filter(i => i).join("\n\n***\n\n")}
endColumns
keyboardNav ${previous.permalink} ${next.permalink}
../footer.scroll
Expand Down
2 changes: 1 addition & 1 deletion blog/print-debugging-in-over-300-languages.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors Breck Yunits
date 2022.07.15
replace PD <b>print("debugging")</b>
tags All
title "print() debugging" in over 300 languages
title print() debugging in over 300 languages

postHeader.scroll
printTitle
Expand Down
4 changes: 2 additions & 2 deletions code/browser/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const initAutocomplete = elementId => {
const htmlEncodedQuery = query.replace(/</g, "&lt;")

suggestions.push({
label: `Full text search for "${htmlEncodedQuery}"`,
label: `Search for "${htmlEncodedQuery}"`,
id: "",
url: normalizeUrl(`/lists/explorer.html#q=${htmlEncodedQuery}`)
})
Expand All @@ -36,7 +36,7 @@ const initAutocomplete = elementId => {
onSelect: item => {
const { url, id } = item
if (id) window.location = url
else window.location = normalizeUrl("/lists/explorer.html#q=" + encodeURIComponent(input.value))
else window.location = normalizeUrl("/search.html#q=" + encodeURIComponent(input.value))
}
})
}
3 changes: 3 additions & 0 deletions footer.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ stumpNoSnippet
a About
href BASE_URL/pages/about.html
span ·
a Search
href BASE_URL/search.html
span ·
a Keywords
href BASE_URL/lists/keywords.html
span ·
Expand Down
2 changes: 1 addition & 1 deletion header.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stumpNoSnippet
form
style display:inline-block;
method get
action BASE_URL/lists/explorer.html
action BASE_URL/search.html
input
type search
id trueBaseThemeHeaderSearch
Expand Down
21 changes: 0 additions & 21 deletions lists/keywords.scroll

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lodash": "^4.17.21",
"monaco-editor": "^0.34.1",
"numeral": "^2.0.6",
"scroll-cli": "^136.4.1",
"scroll-cli": "^136.11.1",
"scrollsdk": "^87.0.0",
"semver": "^7.6.2"
},
Expand Down
15 changes: 15 additions & 0 deletions search.scroll
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title Search PLDB

rootHeader.scroll

printTitle

// Todo: this is pretty amazing that we can just dump plain text versions of over 5,000 files in one HTML table and use DataTables to search...BUT...let's improve (make build speed faster, for example)

container
printSearchTable blog/All features/All concepts/
tableSearch

endColumns

footer.scroll
2 changes: 1 addition & 1 deletion searchForm.scroll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
html
<div class="trueBaseSearchForm trueBaseSearchFormPadded">
<form style="display:inline;" method="get" action="BASE_URL/lists/explorer.html">
<form style="display:inline;" method="get" action="BASE_URL/search.html">
<input name="q" placeholder="Search" autocomplete="off" type="search" id="searchFormInput">
<input class="searchButton" type="submit" value="Search">
</form>
Expand Down

0 comments on commit c5f7a3e

Please sign in to comment.