Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

quicksearch breakage in sphinx 1.8.0 and up #9

Closed
mattip opened this issue Sep 27, 2018 · 6 comments · Fixed by #10
Closed

quicksearch breakage in sphinx 1.8.0 and up #9

mattip opened this issue Sep 27, 2018 · 6 comments · Fixed by #10

Comments

@mattip
Copy link
Contributor

mattip commented Sep 27, 2018

Quicksearch is broken on sphinx 1.8.0 and up, see numpy/numpy#12044. It seems the problem is some interaction with the theme's javascript. here is one example of a fix readthedocs/sphinx_rtd_theme/pull/672

@pv
Copy link
Member

pv commented Sep 27, 2018

The only javascript is
https://github.com/scipy/scipy-sphinx-theme/blob/master/_theme/scipy/static/js/copybutton.js
and the copypaste sphinx template in

{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
<script type="text/javascript" src="{{ pathto('_static/js/copybutton.js', 1) }}"></script>
{%- endmacro %}

@mattip
Copy link
Contributor Author

mattip commented Sep 27, 2018

The fix from rtfd changes the first few lines of that codeblock to read options from documentation_options.js instead.

If I build the NumPy documentation locally and go to the quicksearch link build/html/search.html, I can see there is a javascript error:

jQuery.Deferred exception: Search is not defined @file:////numpy/doc/build/html/search.html?q=ASD:60:25
j@file:///numpy/doc/build/html/_static/jquery.js:2:29997
g/</k<@file:///numpy/doc/build/html/_static/jquery.js:2:30313
 undefined

It seems there is more than one thing going on. Replacing the codeblock you posted with the one from the sphinx basic theme does not clear the javascript error

@mattip
Copy link
Contributor Author

mattip commented Oct 2, 2018

Also see sphinx-doc/sphinx#5460. I am not sure what the upgrade path is to make the theme compliant with the newer version, and what kind of tests exist to make sure it is correct

@rgommers
Copy link
Member

rgommers commented Mar 1, 2019

and what kind of tests exist to make sure it is correct

Just building the NumPy and SciPy docs and inspecting them; we touch this theme so rarely that it doesn't make sense to write tests for it.

@rgommers
Copy link
Member

rgommers commented Mar 1, 2019

sphinx-doc/sphinx#5460 says that a fallback was added and this is fixed again. the milestone for the attached PR says in Sphinx 1.8.3

@mattip
Copy link
Contributor Author

mattip commented Mar 3, 2019

We should still update the theme, but indeed 1.8.3+ is backward compatible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants