Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 27, 2024
1 parent cb556e6 commit 948e2d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions deepmodeling_sphinx/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,19 @@ def rtd_config(app, config):
config.html_context = {}
config.html_context["READTHEDOCS"] = True


def sphinx_book_theme(app, config):
"""Set configurations for sphinx_book_theme."""
if not config.enable_deepmodeling:
return
if config.html_theme != "sphinx_book_theme":
return
icp_footer = (
'<p><a href="https://beian.miit.gov.cn" target="_blank">%s</a></p>'
% icp_no
'<p><a href="https://beian.miit.gov.cn" target="_blank">%s</a></p>' % icp_no
)
config.html_theme_options["extra_footer"] = (
config.html_theme_options.get("extra_footer", "") + icp_footer
)
config.html_theme_options["extra_footer"] = config.html_theme_options.get("extra_footer", "") + icp_footer


def setup(app: Sphinx) -> Dict[str, Any]:
Expand All @@ -220,4 +222,3 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.connect("config-inited", sphinx_book_theme)

return {"parallel_read_safe": True}

0 comments on commit 948e2d5

Please sign in to comment.