Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.0.0' into 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeaTTheatR committed Jan 11, 2024
2 parents e744e19 + 6de40b7 commit fd1384a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ repos:

# Format Python
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.12.1
hooks:
- id: black

# Sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
additional_dependencies: ["toml"]

# Lint Python
- repo: https://gitlab.com/PyCQA/flake8
rev: 4.0.1
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
17 changes: 17 additions & 0 deletions docs/sources/_extensions/autoapi_kivymd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
import autoapi
import sphinx
import unidecode
from autoapi.directives import NestedParse
from autoapi.extension import LOGGER
from autoapi.extension import setup as autoapi_setup
from autoapi.mappers.python.mapper import PythonSphinxMapper
from autoapi.mappers.python.objects import PythonPythonMapper
from docutils import nodes
from sphinx.util.console import bold, darkgreen
from sphinx.util.nodes import nested_parse_with_titles
from sphinx.util.osutil import ensuredir


Expand Down Expand Up @@ -128,7 +131,21 @@ def extension_build_finished(app, exception):
break


def patched_nested_parse_run(self):
node = nodes.container()
node.document = self.state.document
nested_parse_with_titles(self.state, self.content, node)
try:
title_node = node[0][0]
if isinstance(title_node, nodes.title):
title_node.children.pop(0)
except IndexError:
pass
return node.children


def setup(app):
NestedParse.run = patched_nested_parse_run
PythonPythonMapper.pathname = property(PythonPythonMapper_pathname)
PythonPythonMapper.include_dir = PythonPythonMapper_include_dir
PythonSphinxMapper.output_rst = PythonSphinxMapper_output_rst
Expand Down

0 comments on commit fd1384a

Please sign in to comment.