Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing SOURCELINK_SUFFIX #346

Merged
merged 1 commit into from
Dec 9, 2016
Merged

Add missing SOURCELINK_SUFFIX #346

merged 1 commit into from
Dec 9, 2016

Conversation

mikkeloscar
Copy link
Contributor

@mikkeloscar mikkeloscar commented Dec 8, 2016

Adds DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX which is expected by searchtools.js_t

Related sphinx commit: sphinx-doc/sphinx@71dd8bf

I'm using sphinx 1.5-1 and without this fix, search doesn't work:

Uncaught TypeError: Cannot read property 'length' of undefined
    at displayNextItem (searchtools.js:543)
    at Object.query (searchtools.js:574)
    at Object.setIndex (searchtools.js:362)
    at <anonymous>:1:8
    at p (jquery.js:2)
    at Function.globalEval (jquery.js:2)
    at text script (jquery.js:4)
    at Nb (jquery.js:4)
    at A (jquery.js:4)
    at XMLHttpRequest.<anonymous> (jquery.js:4)

Adds DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX which is expected by the
searchtools.js

Related sphinx commit:
sphinx-doc/sphinx@71dd8bf
@ericholscher ericholscher merged commit abfa985 into readthedocs:master Dec 9, 2016
@ericholscher
Copy link
Member

Thanks for sending this along!

@mikkeloscar mikkeloscar deleted the sourcelink branch December 10, 2016 12:45
@mikkeloscar
Copy link
Contributor Author

Hey, what is your release schedule? I looks like a while since the last release :)

@17amrut29
Copy link

17amrut29 commented Jan 24, 2017

@ericholscher - When is this fix going to be released?

jordens added a commit to m-labs/artiq that referenced this pull request Jan 25, 2017
jordens added a commit to m-labs/artiq that referenced this pull request Jan 25, 2017
jonathansick added a commit to lsst-dm/dm_dev_guide that referenced this pull request Feb 3, 2017
The search bug in sphinx-rtd-theme was described and fixed here:
readthedocs/sphinx_rtd_theme#346
but hasn't been released yet. This commit changes requirements.txt to
use a known-working commit on master of snide/sphinx_rtd_theme that
works with sphinx 1.5.2.

Search now works again \o/
@dschiller
Copy link

dschiller commented Feb 17, 2017

Modify C:\Python27\Lib\site-packages\sphinx_rtd_theme\layout.html:

Unfixed:

164 <script type="text/javascript">
165         var DOCUMENTATION_OPTIONS = {
166             URL_ROOT:'{{ url_root }}',
167             VERSION:'{{ release|e }}',
168             COLLAPSE_INDEX:false,
169             FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
170             HAS_SOURCE:  {{ has_source|lower }}
171         };
172 </script>

Fixed:

164 <script type="text/javascript">
165         var DOCUMENTATION_OPTIONS = {
166             URL_ROOT:'{{ url_root }}',
167             VERSION:'{{ release|e }}',
168             COLLAPSE_INDEX:false,
169             FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
170             HAS_SOURCE:  {{ has_source|lower }},
171             SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
172         };
173 </script>

jigold added a commit to jigold/hail that referenced this pull request Apr 25, 2017
 - See readthedocs/sphinx_rtd_theme#346 for description of issue and solution
 - Required for search to work with Sphinx v1.5.4+
danking pushed a commit to hail-is/hail that referenced this pull request May 2, 2017
* Fix searchbar on website

 - See readthedocs/sphinx_rtd_theme#346 for description of issue and solution
 - Required for search to work with Sphinx v1.5.4+

* add minimal version
liameabbott pushed a commit to liameabbott/hail that referenced this pull request May 3, 2017
* Fix searchbar on website

 - See readthedocs/sphinx_rtd_theme#346 for description of issue and solution
 - Required for search to work with Sphinx v1.5.4+

* add minimal version
@alejandrovr
Copy link

Hello,
Which would be the equivalent path for C:\Python27\Lib\site-packages\sphinx_rtd_theme\layout.html in linux? Does it exist?
Could it be something like: .../python/site-packages/sphinx/theme/basic/layout.html ?
Thanks in advance,
Alejandro.

@mikkeloscar
Copy link
Contributor Author

@alejandrovr something like /usr/lib/python3.6/site-packages/sphinx_rtd_theme/layout.html

@alejandrovr
Copy link

@mikkeloscar hmm, weird. I do not have that file, and even better, I do not have any sphinx_rtd_theme directory. However, in the searchtools.js, if I change
var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
by
var suffix = 'py';

everything works, so the problem is there. I am using Sphinx 1.5.6., btw.

Thanks anyway,

Alejandro

CloudNiner pushed a commit to azavea/climate-change-api that referenced this pull request Jun 9, 2017
Issue with sphinx_rtd_theme, see:
readthedocs/sphinx_rtd_theme#346
LeSuisse added a commit to Enalean/tuleap-documentation-en that referenced this pull request Jul 26, 2017
Since the upgrade of Sphinx in our build process (subsequent to the
work done in #50) the search is broken.
The issue was caused by the theme (see readthedocs/sphinx_rtd_theme#346), so
updating our import to the latest stable version (0.2.4) solve the issue.
LeSuisse added a commit to Enalean/tuleap-documentation-en that referenced this pull request Jul 26, 2017
Since the upgrade of Sphinx in our build process (subsequent to the
work done in #50) the search is broken.
The issue was caused by the theme (see readthedocs/sphinx_rtd_theme#346), so
updating our import to the latest stable version (0.2.4) solve the issue.
vbarbaresi pushed a commit to opendatasoft/ods-documentation that referenced this pull request Jul 5, 2018
@jmckenna
Copy link

jmckenna commented Apr 5, 2019

This exact issue still exists with the recent Sphinx 2.0.0 release and sphinx_rtd_theme 0.4.3:

404 (not found) /_sources/myfolder/filename.txt.txt

...where the correct file is named "filename.txt"

(test live at https://mapserver.org/search.html )

@jpreese
Copy link

jpreese commented Dec 30, 2020

Recently ran into this as well. Is there a known sphinx_rtd_theme + sphinx version combination that works?

When using search, all of the links end with undefined

@stsewd
Copy link
Member

stsewd commented Jan 4, 2021

@jpreese think one or two releases back in sphinx will fix the problem, but I think this is already fixed in master and we just need to push a new version, I'll see if we can do that.

@jpreese
Copy link

jpreese commented Jan 5, 2021

Thank you @stsewd! Much appreciated. I have yet been able to find a RTD/Sphinx combination that works.

edit: Just saw that 0.5.1 was released and it does appear to be working with Sphinx 3.4.2!

RUN pip3 install sphinx==3.4.2 sphinx_rtd_theme==0.5.1

Thanks!

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

Successfully merging this pull request may close these issues.

8 participants