-
Notifications
You must be signed in to change notification settings - Fork 90
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: Add search ranking and use latest Python version #242
Conversation
Add a ranking which search results should pop up first (proposed docs/source > ema_workbench/examples > ema_workbench > everything else > all models). See https://docs.readthedocs.io/en/stable/config-file/v2.html#search Also always use latest stable Python version.
0acdc4b
to
506ff0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and ranking makes sense.
for me as well. Seems related to this StackOverflow issue edit: checked readthedocs and indeed it is this exact issue. So all that is needed is forcing the use of the latest version of the theme. edit2: the fix seems to be to include sphinx_rtd_theme>0.5 explicitly in pyproject.toml. |
Good catch!
And this again seemed to be caused by readthedocs/readthedocs.org#7858. If we look at a recent build log, we're currently installing:
But then in the next step, where our optional
So we get Let me try to fix that. |
- Set sphinx-rtd-theme as optional docs dependency - Specify needs_sphinx and needs_extensions in the conf.py configuration file (see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-needs_sphinx)
02ae337
to
9baad82
Compare
Try something else to set the docs requirements
Of course nothing can't be simple. I will take a better look at this later this week. |
I checked the build LOG and we are now installing the correct versions. However, this does not seem to resolve the problem. Reading up on readthedocs, they seem to still prefer using requirements files instead of pyproject.toml. See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html. So, we might give that a try by having a requirements.in and requirements.txt in the docs directory somewhere. See also https://github.com/readthedocs/readthedocs.org/tree/main/requirements for some examples. |
Yeah I also noticed that. Let's see what they think of it upstream: readthedocs/readthedocs.org#9642 (comment) |
Tried following their documentation to the letter, but still doesn't work. This is one of the most stubborn issues I encountered in a long time. I filed a new issue upstream: readthedocs/readthedocs.org#10263 |
Implement a workaround to get search working again readthedocs/sphinx_rtd_theme#1452 (comment)
I would have liked to cleaned up this PR some more, and test the search ranking some more. Please wait for explicit go ahead for merging, especially after such a convoluted history. Anyway, glad to have search working again, I will test tomorrow if the search ordering makes sense, and probably open a PR to revert the docs requirements changes. |
My mistake. Had github open, saw the e-mail about the search fix, and just clicked merge on the only open pull request without first refreshing Github. |
* readthedocs: Add search ranking and use latest Python version Add a ranking which search results should pop up first (proposed docs/source > ema_workbench/examples > ema_workbench > everything else > all models). See https://docs.readthedocs.io/en/stable/config-file/v2.html#search Also always use latest stable Python version. * docs: sphinx-rtd-theme as optional dep, specify needs_sphinx - Set sphinx-rtd-theme as optional docs dependency - Specify needs_sphinx and needs_extensions in the conf.py configuration file (see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-needs_sphinx) * Update .readthedocs.yaml Try something else to set the docs requirements * Update .readthedocs.yaml * readthedocs-sphinx-ext update * Attempt to fix search by using requirements.txt * Add general requirements to docs * docs: conf.py: Implement search workaround Implement a workaround to get search working again readthedocs/sphinx_rtd_theme#1452 (comment) --------- Co-authored-by: Jan Kwakkel <[email protected]>
Add a ranking which search results should pop up first (proposed docs/source > ema_workbench/examples > ema_workbench > everything else > all models).
This will make sure that the docs pop up on top, then the examples, then the source code, then all other stuff (including tests) and then the included models. Please let know what you think of this ranking.
Some files are also excluded, most notably the data folders.
See Configuration file v2#search
Also always use latest stable Python version and build a downloadable htmlzip.
Furthermore, we could consider adding Search as you type with the readthedocs-sphinx-search extension. Also we might take a look (during the course) on search analytics to see where we can improve.