jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
191 stars 29 forks source link

Bugs with search when deployed to readthedocs #208

Closed vsoch closed 1 year ago

vsoch commented 1 year ago

Hiya! Everything in the theme works great locally, and on GitHub pages, but on readthedocs I see:

image

and you can try it out here https://flux-framework.readthedocs.io/en/latest/index.html

Issue opened https://github.com/flux-framework/flux-docs/issues/187 and the raw source is at https://github.com/flux-framework/flux-docs.

I think likely we forgot a module or similar - any quick help would be appreciated since our main docs are broken!

jbms commented 1 year ago

The basic issue is that this theme excludes certain JavaScript modules that are installed by the basic Sphinx theme, since this theme does not use anything from the basic Sphinx theme and does not require those modules. However, some other extensions that you are using may be relying on those modules. DOCUMENTATION_OPTIONS is also something we exclude since it is not needed by this theme.

We already have some logic to include certain modules when building on rtd: https://github.com/jbms/sphinx-immaterial/blob/0cbc073a9a3657b3fec41a0769f9272e840cf942/sphinx_immaterial/__init__.py#L127

Perhaps that needs to be updated, though.

I also noticed in your configuration that you are using the readthedocs-sphinx-search extension, which is also the cause of some of those errors. This theme already provides similar functionality out-of-the-box, so I think you could exclude that extension.

jbms commented 1 year ago

Additionally there is one error from the sphinx-copybutton extension. That functionality is also already provided by this theme, so you could also exclude that extension.

vsoch commented 1 year ago

okay then for first step I will remove those two!

vsoch commented 1 year ago

That fixed it! Thank you so much! :pray: image