Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search for the docs #16

Open
irh opened this issue Aug 14, 2024 · 1 comment
Open

Add search for the docs #16

irh opened this issue Aug 14, 2024 · 1 comment

Comments

@irh
Copy link
Contributor

irh commented Aug 14, 2024

It would be great to be able to search the docs.

Zola supports generating a search index, but I don't know how that will work with versioned docs.

I think that searching for starts should provide a single result for string.starts_with, from the version of the docs that you're looking at.

This might mean that separate search indexes will need to be maintained, and I don't know if Zola supports that. Or maybe there'll be some trick for filtering the index, but then I'm worried that the index will grow too large over time as new versions are added.

So there might need to be some kind of manual solution. There's a lot of preprocessing of the docs going on in xtask, so maybe a search index could be generated there, rather than relying on Zola's solution.

@irh
Copy link
Contributor Author

irh commented Aug 19, 2024

It seems like a manually generated search index will be needed. convert_docs in xtask parses the original Koto markdown docs and prepares them for the website, and it might be simple enough to extend the logic so that it adds entries to a search index. A separate xtask command would also be ok if it would be simpler.

The Koto REPL's help command also builds up its search index by parsing the markdown docs, see here for the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant