evidence icon indicating copy to clipboard operation
evidence copied to clipboard

Add search capability to output

Open andrejohansson opened this issue 1 year ago • 11 comments

Feature Description

I would like to have ability to search my generated page in the same way that the following projects do it:

Please note that this may sound similar to #177 but in that ticket search was added to Evidence Documentation, not to the generated evidence page.

Goal of Feature

Generating documentation with evidence data reports is nice, but documentation quickly grows big and requires search capabilities.

Current Solution / Workarounds

No

Alternatives

If evidence can be injected into Docusaurus instead of being the main owner of the layout.

andrejohansson avatar Jan 26 '24 13:01 andrejohansson

I noticed Svelte has a nice search feature in their tutorial project: https://learn.svelte.dev/tutorial/welcome-to-svelte

It uses their internal site-kit tools. We may be able to follow a similar approach: https://github.com/sveltejs/site-kit/tree/master/packages/site-kit/src/lib/search

hughess avatar Jan 27 '24 15:01 hughess

We have added the ability to configure Algolia Docsearch

You can add this from a custom layout

https://docs.evidence.dev/themes-and-layouts/#custom-layout

archiewood avatar Mar 26 '24 13:03 archiewood

See: https://github.com/evidence-dev/evidence/pull/1646

archiewood avatar Mar 26 '24 13:03 archiewood

Propose we keep this open for now -- algolia only works if your project is public and algolia accepts you into their docsearch program

mcrascal avatar Mar 26 '24 13:03 mcrascal

Flexsearch looks interesting. A sample integration with sveltekit can be seen here

  • https://joyofcode.xyz/blazing-fast-sveltekit-search

andrejohansson avatar Mar 26 '24 14:03 andrejohansson

@andrejohansson how useful would search against just the markdown contents of your project be? Search that excludes the results of your queries is a much simpler proposition than search against the entire final results of the build that include the results of queries.

mcrascal avatar Mar 26 '24 15:03 mcrascal

Very very useful.

You can see it yourself since you changed your docs to evidence. You include algolia there (which I assume doesn´t traverse the data either).

Our page is an internal documentation site and therefore we cannot use Algolia or similar third party providers.

andrejohansson avatar Apr 15 '24 13:04 andrejohansson

@mcrascal how are your thoughts going regarding this? Anything I can do to help here?

andrejohansson avatar May 02 '24 09:05 andrejohansson

@andrejohansson no updates - we want to add it, but haven't been able to prioritize it yet. @ItsMeBrianD is quite interested in using https://github.com/askorama/orama when we do.

Certainly we'd welcome a contribution if you're interested in working on it.

mcrascal avatar May 13 '24 15:05 mcrascal

I did think of a way that may work for this:

We can likely iterate through the built pages in the evidence cli after the vite build has finished and build the search indexes based on those results

ItsMeBrianD avatar May 13 '24 21:05 ItsMeBrianD

@ItsMeBrianD this plugin does something similar for docusaurus: https://github.com/daldridge/docusaurus-plugin-lunr

andrejohansson avatar Jun 10 '24 12:06 andrejohansson