Skip to content

Commit

Permalink
Convert theme to theme
Browse files Browse the repository at this point in the history
  • Loading branch information
guyer committed Mar 6, 2024
1 parent 574a44b commit 8bd9754
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ntd2d/ntd2d_action/sphinxdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ def epub_file(self):
def pdf_file(self):
return self.build_dir / "latex" / f"{self.conf.project.lower()}.pdf"

def get_theme(theme_name):
theme_factory = HTMLThemeFactory(self.sphinx_app)
return theme_factory.create(theme_name)

@property
def stylesheet(self):
theme_factory = HTMLThemeFactory(self.sphinx_app)
theme = theme_factory.create(self.sphinx_app.config.html_theme)
theme = self.get_theme(self.sphinx_app.config.html_theme)

return theme.get_config("theme", "stylesheet")

Expand Down Expand Up @@ -164,7 +167,7 @@ def get_theme_layout(theme):
else:
return get_theme_layout(theme.base)

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

def assimilate_theme(self, name, insert_header_footer=True):
"""Replace configuration directory with customized html theme."""
Expand Down

0 comments on commit 8bd9754

Please sign in to comment.