Skip to content

Commit

Permalink
Disables apidoc/python/section_titles monkey patch for Sphinx >= 5.3
Browse files Browse the repository at this point in the history
This is unnecessary due to
sphinx-doc/sphinx#10887, which adds support
for section titles in all object description content.
  • Loading branch information
jbms committed Jan 22, 2023
1 parent 4ea9b28 commit 1691db1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sphinx_immaterial/apidoc/python/default.py
@@ -1,3 +1,4 @@
import sphinx
import sphinx.application

from . import annotation_style
Expand All @@ -9,11 +10,13 @@
from . import attribute_style
from . import napoleon_admonition_classes
from . import strip_property_prefix
from . import section_titles
from . import autodoc_property_type
from . import type_annotation_transforms
from . import strip_self_and_return_type_annotations

if sphinx.version_info < (5, 3):
from . import section_titles


def setup(app: sphinx.application.Sphinx):
app.setup_extension(parameter_objects.__name__)
Expand Down
5 changes: 5 additions & 0 deletions sphinx_immaterial/apidoc/python/section_titles.py
@@ -1,10 +1,15 @@
import docutils.nodes
import docutils.statemachine

import sphinx
from sphinx.domains.python import PyObject
import sphinx.util.nodes


# Not needed in Sphinx 5.3
assert sphinx.version_info < (5, 3)


def _monkey_patch_python_domain_to_support_titles():
"""Enables support for titles in all Python directive types.
Expand Down

0 comments on commit 1691db1

Please sign in to comment.