Skip to content

Commit

Permalink
Support searchtools override regardless of Sphinx version
Browse files Browse the repository at this point in the history
This takes the underlying searchtools.js_t out of the Sphinx distribution
path, patches it, and then fills the context and parses it as a templated
javascript file. This allows us to remove the script initialization on all
versions of this file.

The initialization block on searchtools.js_t has not changed in 10 years, so
this method should be safe. If the block changes in the future, tests will grab
this as we add new versions of Sphinx to our testing.

This reorganizes some repetitive code and cleans up a few other pieces as well:

File copying is linked to the standard copy_static_files that is run from
the builder. Running from an event on build finished was producing files without
the template context. This is because build-finished is always triggered, but
the static files are not always copied (and therefore did not have the same
template context?)

Fixes #25
Refs readthedocs/readthedocs.org#2708
  • Loading branch information
agjohnson committed May 3, 2017
1 parent 5563e4c commit 0d89eb5
Show file tree
Hide file tree
Showing 13 changed files with 271 additions and 551 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
language: python
python:
- 2.7
- 2.7
- 3.4
- 3.5
- 3.6
sudo: false
env:
- TOX_ENV=lint
- TOX_ENV=py27
- TOX_ENV=py34
matrix:
include:
- python: 2.7
script: tox -e lint
install:
- pip install tox
- pip install tox-travis
script:
- tox -e $TOX_ENV
- tox
notifications:
slack:
rooms:
Expand Down
Loading

0 comments on commit 0d89eb5

Please sign in to comment.