|
206 | 206 |
|
207 | 207 | def setup(app): |
208 | 208 |
|
209 | | - def setup_sphinx_compatibility(): |
210 | | - """ |
211 | | - Resolve problem with `sphinx_build_compatibility` extension. |
212 | | -
|
213 | | - Add Sphinx extension at runtime, in order to be able to configure it previously. |
214 | | - This is needed because it has some quirks that reveal themselves when invoked in |
215 | | - non-RTD environments. |
216 | | -
|
217 | | - - https://github.com/crate/crate-docs-theme/issues/536 |
218 | | - - https://about.readthedocs.com/blog/2024/07/addons-by-default/ |
219 | | - - https://github.com/readthedocs/sphinx-build-compatibility |
220 | | - """ |
221 | | - |
222 | | - # Extension error (sphinx_build_compatibility.extension): |
223 | | - # Handler <function manipulate_config at 0x10a4289a0> for event 'config-inited' threw an exception |
224 | | - # (exception: argument of type 'NoneType' is not iterable) |
225 | | - os.environ.setdefault("READTHEDOCS_GIT_CLONE_URL", "") |
226 | | - |
227 | | - # IndexError: list index out of range |
228 | | - # project_id = response_project["results"][0]["id"] |
229 | | - # Currently needs a valid project on PyPI. Long-term fix should go into upstream code. |
230 | | - os.environ.setdefault("READTHEDOCS_PROJECT", "crate-docs-theme") |
231 | | - |
232 | | - # Exception: 'NoneType' object is not subscriptable |
233 | | - os.environ.setdefault("READTHEDOCS_GIT_COMMIT_HASH", "") |
234 | | - |
235 | | - # Register vendorized Sphinx plugin. |
236 | | - app.setup_extension("crate.theme.vendor.rtd_compat.extension") |
237 | | - |
238 | 209 | # Configure Sphinx/RTD to host projects on a custom domain, but also on a non-root resource. |
239 | 210 | def configure_self_hosted_on_path(app_inited): |
240 | 211 | """ |
@@ -328,9 +299,6 @@ def apply_html_context_custom(app_inited): |
328 | 299 | except Exception as ex: |
329 | 300 | print(f"ERROR: Unable to adjust `html_context`. Reason: {ex}") |
330 | 301 |
|
331 | | - # Read The Docs compatibility issues. |
332 | | - setup_sphinx_compatibility() |
333 | | - |
334 | 302 | # Modern / NG / Furo. |
335 | 303 | app.require_sphinx("3.0") |
336 | 304 | app.connect("html-page-context", _html_page_context) |
|
0 commit comments