Skip to content

Commit

Permalink
A hack to fix broken search bar
Browse files Browse the repository at this point in the history
Current version of xgboost.readthedocs.io has a broken search box.
Enabling themes on ReadTheDocs is known to break the search function, as
reported in
[this document](readthedocs/readthedocs.org#1487). To get
around the bug, we replace the `searchtools.js` file with our custom version.

How to test
* Download `searchtools.js` to your home folder.
* Run `python -m SimpleHTTPServer`.
* Open the web browser and browse to http://localhost:8000/searchtools.js
  Make sure that you can access the script using this address.
* Download the Google Chrome extension [Resource Override](https://chrome.google.com/webstore/detail/resource-override/pkoacgokdfckfpndoffpifphamojphii)
  This will let you subtitute the custom script for the hosted script.
* Set following the replacement rule:
```
   https://xgboost.readthedocs.io/en/latest/_static/searchtools.js
=> http://localhost:8000/searchtools.js
```
* Browse to https://xgboost.readthedocs.io/en/latest/ and try the search box.
  Google Chrome will warn you about "loading scripts from unauthenticated
  sources." Click "Load unsafe scripts."
* The search function should work with the custom script loaded.
* Once done, make sure to delete the Google Chrome extension and shut down
  `SimpleHTTPServer`.
  • Loading branch information
hcho3 committed Aug 6, 2017
1 parent 70b65a2 commit d89165f
Showing 1 changed file with 752 additions and 0 deletions.
Loading

0 comments on commit d89165f

Please sign in to comment.