Search code examples
python-sphinxread-the-docs

broken search field of python-sphinx website on reathedocs.org


I discovered that the search function of the latest version of my website eswp3.org hosted on readthedocs.org does not work anymore. I use the default search functionality of the python-sphinx html theme sphinx_rtd_theme. I use the default makefile to build the html files.

Some possible bug cause investigation:

  • The search field of website versions v1.1 and website version v1.0 is broken.
  • In website version V0.1 the search field is working. (Versions may be switched with the field in the bottom left on the website.)
  • After rebuilding the website sources v1.0 and on the local file system the search field of v1.0 does not work, the search field of v0.1 does work.
  • Comparing the website source v1.0 and v0.1 lead to following differences:

To the diff screenshot

  • I checked the differences in conf.py but i did not catch critical differences.
  • I deleted the files in _build/html and rebuilt the files with the python-sphinx default make target make html in the root directory eswp3/ on my local file system. No problems regarding indexing have been printed.
  • Unfortunately the search field in the generated version is also not working.

What did i miss? Do i have to consider possible differences of the python-sphinx versions used in the different builds?

Thanks a lot in advance.


Solution

  • Some files edited on windows machines have not been commited to github as UTF-8 format files but WINDOWS-1252 format files initially or after file edits. Converting all *.rst files to UTF-8 did the job (e.g. by converting all *.srt files of the current directory on UNIX into a subfolder /utf-8 using find . -name "*.rst" -exec iconv -f WINDOWS-1252 -t UTF-8 {} -o utf-8/{} \;).