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

readthedocs.org search is broken #3376

Closed
mgsloan opened this issue Aug 22, 2017 · 12 comments
Closed

readthedocs.org search is broken #3376

mgsloan opened this issue Aug 22, 2017 · 12 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Aug 22, 2017

Thinking this is likely a readthedocs bug, but perhaps it is some configuration issue. Seems that the search on https://docs.haskellstack.org/en/stable/README/ doesn't work. If I input keywords that are definitely used, like stack, I get no results - https://readthedocs.org/search/?q=stack&check_keywords=yes&area=default&project=stack&version=stable&type=file

Pinging @borsboom

@decentral1se
Copy link
Member

decentral1se commented Aug 22, 2017

Check out #3298 😞

@mgsloan
Copy link
Contributor Author

mgsloan commented Aug 22, 2017

This guy's workaround - readthedocs/readthedocs.org#1487 (comment) - seems ok: nodemcu/nodemcu-firmware@7dd89dd . Stack's docs are not huge, so doing clientside search seems fine, perhaps even a better option, for offline use.

@borsboom
Copy link
Contributor

That workaround certainly seems like a reasonable thing to try. We'd probably need to add an extra_javascript clause to mkdocs.yml (like this)

@decentral1se
Copy link
Member

Nice detective work :shipit:

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

The docs for the branch, for whatever reason, decided to build successfully (even though most builds are still failing). In the JS console, I get a 404 when it tries to load https://docs.haskellstack.org/en/fixup-search/etc/mkdocsjs/searchhack.js. That's because the extra_javascript setting in mkdocs.yml should be within the doc directory. I've pushed a new branch 3376-fix-search that fixes that... hopefully mkdocs will build it.

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

Mkdocs does seem to have rendered the docs: https://docs.haskellstack.org/en/3376-fix-search/README/.

However, search still doesn't work.

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

I suspected that the if (window.location.origin.indexOf('readthedocs') > -1) check was the reason, so I tried using http://stack.readthedocs.io/en/stable/README/ instead but also didn't work at that URL.

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

Oh, woops, I pointed to the wrong branch on stack.readthedocs.io. If I go to http://stack.readthedocs.io/en/3376-fix-search/README/ the search box actually disappears, but there's this much more informative error in the JS console:

ReferenceError: determineSelectedBranch is not defined
at MutationObserver. (searchhack.js:16)

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

I've pushed a fix, trying to force a build again.

borsboom pushed a commit that referenced this issue Sep 4, 2017
@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

Fix seems to have worked! Try it out at https://docs.haskellstack.org/en/3376-fix-search/README/. I've opened PR #3415 with @lwm's original changes plus my fixes.

@borsboom
Copy link
Contributor

borsboom commented Sep 4, 2017

Incidentally, you may be amused at my way of getting RTFD to render the docs:

while ! curl --fail https://docs.haskellstack.org/en/3376-fix-search/README/ >/dev/null; do
  curl -v -F 'version_slug=3376-fix-search' https://readthedocs.org/build/41861
  sleep 60
done

@decentral1se
Copy link
Member

Heroic effort @borsboom! 👏

borsboom added a commit that referenced this issue Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants