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
Example: adding Algolia Docsearch to a Sphinx setup that uses 'sphinx_rtd_theme' #761
Comments
Thanks for your comment, hopefully this will help others in the future. I'll close this ticket, since there is nothing left to do but keep it readable for posterity. |
@boy-vd do you have any thoughts on whether algolia could work on a multi-version site? E.g. we have |
You can use algolia on multi version sides using facetfilters. This is an example docsearch config that labels the search index entries with a version tag. I have also seen config that solve this problem like this
You enable facet filters in the docseach js script like this
|
Do not know how to turn on search for Material theme, might need to override the layout.html Example from here readthedocs/sphinx_rtd_theme#761
@boy-vd @joleroi I am exploring https://github.com/algolia/autocomplete to create a instant search with autocomplete which shows matching page names and if possible, API classes, methods, etc. that also show up in toctree if |
Hi sphinx. I'll be seeing ya. This side of the other. |
I'm sorry if this isn't the right place to share, but since I struggled quite a bit with getting Algolia DocSearch to work I thought others might appreciate it as a useful example. I initially wrote and shared this as a reply to an issue on the official Sphinx GitHub repo: sphinx-doc/sphinx#3812.
The following configuration works well for a Sphinx 1.8.5 environment with
sphinx_rtd_theme
version 0.4.3. It's very easy to implement (basically copy-paste everything to the correct places and make sure to add your own <API_KEY> and <INDEX_NAME>):The
algolia.css
file in the_static
directory contains the following:And the
algolia.js
file in the same_static
directory contains this:The above setup makes use of the public crawler that Algolia hosts for free on their servers: https://community.algolia.com/docsearch/dropdown.html. Implementing it based on a crawler that you build yourself shouldn't be much different: https://community.algolia.com/docsearch/run-your-own.html.
The text was updated successfully, but these errors were encountered: