ansys / ansys-sphinx-theme

PyData-based Sphinx theme from the PyAnsys community
https://sphinxdocs.ansys.com
MIT License
23 stars 8 forks source link

Searching doesn't work when opening HTML docs directly as files #581

Open Andy-Grigg opened 5 hours ago

Andy-Grigg commented 5 hours ago

🔍 Before submitting the issue

🐞 Description of the bug

When opening the HTML files generated using this theme locally, the search functionality doesn't work. Additionally, there are lots of errors logged in the devtools console when opening the HTML, browsing, searching, etc. in the following areas:

If we intend people to access the HTML docs offline, we shouldn't be raising exceptions when they are loaded as files directly in a browser.

📝 Steps to reproduce

  1. Generate the docs using sphinx with the latest version of this package
  2. Open them in a browser directly, instead of accessing them via a web server

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

N/A

🐍 Which Python version are you using?

3.12

📦 Installed packages

accessible-pygments==0.0.5 alabaster==0.7.16 -e git+https://github.com/ansys/grantami-bomanalytics.git@73ed903bc29ffea3edb58de5c9dca0d6d98f9544#egg=ansys_grantami_bomanalytics ansys-grantami-bomanalytics-openapi==3.1.0rc1 ansys-openapi-common==2.2.0 ansys-sphinx-theme==1.2.0 anyio==4.6.2.post1 apeye==1.4.1 apeye-core==1.1.5 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 attrs==24.2.0 autodocsumm==0.2.14 babel==2.16.0 beautifulsoup4==4.12.3 bleach==6.1.0 CacheControl==0.14.0 certifi==2024.8.30 cffi==1.17.1 charset-normalizer==3.4.0 colorama==0.4.6 comm==0.2.2 coverage==7.6.4 cryptography==43.0.3 cssutils==2.11.1 debugpy==1.8.7 decorator==5.1.1 defusedxml==0.7.1 dict2css==0.3.0.post1 docutils==0.21.2 domdf-python-tools==3.9.0 elementpath==4.5.0 enum-tools==0.12.0 executing==2.1.0 fastjsonschema==2.20.0 filelock==3.16.1 fqdn==1.5.1 h11==0.14.0 html5lib==1.1 httpcore==1.0.6 httpx==0.27.2 idna==3.10 imagesize==1.4.1 importlib_metadata==8.5.0 iniconfig==2.0.0 ipykernel==6.29.5 ipython==8.29.0 ipywidgets==8.1.5 isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.4 json5==0.9.25 jsonpointer==3.0.0 jsonschema==4.23.0 jsonschema-specifications==2024.10.1 jupyter-events==0.10.0 jupyter-lsp==2.2.5 jupyter_client==8.6.3 jupyter_core==5.7.2 jupyter_server==2.14.2 jupyter_server_terminals==0.5.3 jupyterlab==4.3.0 jupyterlab_pygments==0.3.0 jupyterlab_server==2.27.3 jupyterlab_widgets==3.0.13 jupytext==1.16.4 lxml==5.3.0 markdown-it-py==3.0.0 MarkupSafe==3.0.2 matplotlib-inline==0.1.7 mdit-py-plugins==0.4.2 mdurl==0.1.2 mistune==3.0.2 more-itertools==10.5.0 msgpack==1.1.0 mypy==1.13.0 mypy-extensions==1.0.0 natsort==8.4.0 nbclient==0.10.0 nbconvert==7.16.4 nbformat==5.10.4 nbsphinx==0.9.5 nest-asyncio==1.6.0 notebook_shim==0.2.4 numpy==2.1.2 numpydoc==1.8.0 overrides==7.7.0 packaging==24.1 pandas==2.2.3 pandocfilters==1.5.1 parso==0.8.4 pdf2image==1.17.0 pillow==11.0.0 platformdirs==4.3.6 plotly==5.24.1 pluggy==1.5.0 prometheus_client==0.21.0 prompt_toolkit==3.0.48 psutil==6.1.0 pure_eval==0.2.3 pycparser==2.22 pydata-sphinx-theme==0.15.4 Pygments==2.18.0 pyparsing==3.2.0 pypiwin32==223 pyspnego==0.11.1 pytest==8.3.3 pytest-cov==6.0.0 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 pytz==2024.2 pywin32==308 pywinpty==2.0.14 PyYAML==6.0.2 pyzmq==26.2.0 referencing==0.35.1 requests==2.32.3 requests-mock==1.12.1 requests-negotiate-sspi==0.5.2 requests_ntlm==1.3.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rpds-py==0.20.0 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.12 Send2Trash==1.8.3 setuptools==75.2.0 six==1.16.0 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.6 Sphinx==8.1.3 sphinx-autodoc-typehints==2.3.0 sphinx-copybutton==0.5.2 sphinx-jinja2-compat==0.3.0 sphinx-notfound-page==1.0.4 sphinx-prompt==1.9.0 sphinx-tabs==3.4.5 sphinx-toolbox==3.8.1 sphinx_design==0.6.1 sphinxcontrib-applehelp==2.0.0 sphinxcontrib-devhelp==2.0.0 sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 sspilib==0.2.0 stack-data==0.6.3 tabulate==0.9.0 tenacity==9.0.0 terminado==0.18.1 tinycss2==1.4.0 tornado==6.4.1 traitlets==5.14.3 types-python-dateutil==2.9.0.20241003 typing_extensions==4.12.2 tzdata==2024.2 uri-template==1.3.0 urllib3==2.2.3 wcwidth==0.2.13 webcolors==24.8.0 webencodings==0.5.1 websocket-client==1.8.0 widgetsnbextension==4.0.13 xmlschema==3.4.2 zipp==3.20.2

Andy-Grigg commented 5 hours ago

I discovered this as part of an internal effort to use this theme for a closed-source Python package, where we distribute the HTML files with the package itself. Instead we're looking at using the pydata theme with the custom CSS defined in this project. The pydata theme seems to handle being opened as a file, and doesn't show the same issues in this ticket, which implies it's related to the custom configuration in our theme.