bashtage / sphinx-material

A material-based, responsive theme inspired by mkdocs-material
Other
317 stars 91 forks source link

Support for RTD Sphinx Search #106

Closed axsaucedo closed 3 years ago

axsaucedo commented 3 years ago

The readthedocs sphinx search is quite a useful addition to enable documentation users to get a dynamic experience when searching for resources in the documentation. Currently it seems that the theme doesn't support it when enabled as an extension, potentially just due to some missing class in the search bar.

More info on RTD sphinx search extension: https://readthedocs-sphinx-search.readthedocs.io/en/latest/?rtd_search=this%20is%20the

Demo in RTD sphinx search page: https://readthedocs-sphinx-search.readthedocs.io/en/latest/?rtd_search=testing

bashtage commented 3 years ago

It doesn't seem to have role="search" on the input box.

bashtage commented 3 years ago

This works as expected. Note that this search only works on RTD.

https://sphinx-material.readthedocs.io/en/latest/?rtd_search=rst

axsaucedo commented 3 years ago

Oh awesome - yeah that looks great, thank you @bashtage. Just to clarify, the fix woudl be to manually add a template on our side that has the "search" role, or how would you recommend enabling this?

bashtage commented 3 years ago

No code changes needed. Just install and then add the extension to conf.py, and publish on RTD. The frustrating thing here is that it won't work locally -- maybe RTD provides a backend server?

axsaucedo commented 3 years ago

Interesting, ok let me give that a try and update on results. Thank you @bashtage