How do I override the default Search html that comes with the Sphinx RTD theme. I am on Sphinx 1.5 and the theme is always imported and not static.
Asked
Active
Viewed 2,434 times
2
-
Not clear. Do you want to update the HTML that is generated in the Search results or the CSS from the theme? – Steve Piercy May 24 '17 at 17:35
-
Yes. We want to have a better search filter. We need to edit Search.html. – veenamj May 25 '17 at 05:31
1 Answers
4
See Templating in the Sphinx documentation.
To customize the output of your documentation you can override all the templates (both the layout templates and the child templates) by adding files with the same name as the original filename into the template directory of the structure the Sphinx quickstart generated for you.
Sphinx will look for templates in the folders of templates_path first, and if it can’t find the template it’s looking for there, it falls back to the selected theme’s templates.
In your case, copy the RTD Sphinx theme's search.html
from your installed package into your template directory, and modify it to your liking. Then set the value of templates_path
in your conf.py
to its location.

Steve Piercy
- 13,693
- 1
- 44
- 57