Skip to content

Commit

Permalink
Debug theme recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
guyer committed Mar 6, 2024
1 parent ea9eed9 commit 594dc07
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ntd2d/ntd2d_action/sphinxdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from sphinx.theming import HTMLThemeFactory
import subprocess
import tempfile
import github_action_utils as gha_utils

from .files import ConfFile
from .files import SphinxLog, BorgedConfFile, TemplateHierarchy
Expand Down Expand Up @@ -162,9 +163,15 @@ def inherited_layout(self):
https://github.com/sphinx-doc/sphinx/issues/12049
"""
def get_theme_layout(theme):
gha_utils.echo(f"get theme layout for {theme.name}",
use_subprocess=True)
if (pathlib.Path(theme.themedir) / "layout.html").exists():
gha_utils.echo(f"{theme.name} has layout",
use_subprocess=True)
return f"{theme.name}/layout.html"
else:
gha_utils.echo(f"{theme.name} doesn't have layout: RECURSION",
use_subprocess=True)
return get_theme_layout(theme.base)

return get_theme_layout(self.get_theme(self.inherited_theme))
Expand Down

0 comments on commit 594dc07

Please sign in to comment.