p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Allow searching through the descriptions of reference pages, and not just through their titles

Open bojidar-bg opened this issue 1 year ago • 4 comments

Most appropriate sections of the p5.js website?

Reference

What is your operating system?

Linux

Web browser and version

127.0.2

Actual Behavior

When searching for e.g. "smallest", search currently returns no results -- despite min() being described as "Returns the smallest value in a sequence of numbers". Meanwhile searching for e.g. "radial", correctly returns the color gradient tutorial, described as "Use radial gradients, linear gradients, and blend modes to create lens flare stickers & colorful filters on top of a webcam selfie.'

Expected Behavior

Search finds reference results based on the text contained within the reference entry, and not just based on the name of the function - after all, if someone wanted to match the reference entry names only, they could use the search box on the reference page itself.

Steps to reproduce

  • Open https://p5js.org/search/?term=smallest
  • Observe that min() is missing from the results

Would you like to work on the issue?

Someone else may claim the issue.

bojidar-bg avatar Aug 22 '24 09:08 bojidar-bg

As mentioned on the linked issue: if search index size (both in storage and during download) is a problem, there are some tools that might help pack it more optimally; see e.g. this page on Hugo's website describing search.

(In particular, pagefind looks promising)

bojidar-bg avatar Sep 08 '24 18:09 bojidar-bg

Hi @bojidar-bg & @limzykenneth,

I would like to contribute to this issue. Please assign this to me.

Thanks!

akkarn1689 avatar Feb 19 '25 17:02 akkarn1689

Thanks @akkarn1689! I'll assign this to you, but before going ahead with a full solution, it might make sense to investigate some of the potential paths forward @bojidar-bg mentioned, experimenting to see what kinds of code size tradeoffs we see. (The reason why it only searches titles right now is a compromise between functionality and load time: our deployment is on GitHub Pages, with no backend, meaning that all the search happens browser-side, and so we have to load all the searchable content upfront.) Let us know in the comments what direction you plan on going in, and what your findings are 🙂

davepagurek avatar Feb 19 '25 20:02 davepagurek

Hi @davepagurek,

I am looking into the potential paths suggested by @bojidar-bg. Will share my findings ASAP.

akkarn1689 avatar Feb 20 '25 13:02 akkarn1689