Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
  • Loading branch information
astrojuanlu committed Oct 1, 2024
1 parent a32258c commit a7f904f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/kedro_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
THEME_PATH = (Path(__file__).parent / "theme" / "kedro-sphinx-theme").resolve()


def env_override(default_appid):
def env_override(default_appid: str) -> str:
"""Override Heap ID based on the build version."""
build_version = os.getenv("READTHEDOCS_VERSION")

Expand All @@ -24,7 +24,7 @@ def env_override(default_appid):
return default_appid # default to Development for local builds


def _add_jinja_filters(app):
def _add_jinja_filters(app: Sphinx) -> None:
# https://github.com/crate/crate/issues/10833
from sphinx.builders.latex import LaTeXBuilder
from sphinx.builders.linkcheck import CheckExternalLinksBuilder
Expand All @@ -35,14 +35,14 @@ def _add_jinja_filters(app):
app.builder.templates.environment.filters["env_override"] = env_override


def _override_permalinks_icon(app):
def _override_permalinks_icon(app: Sphinx) -> None:
# https://github.com/readthedocs/sphinx_rtd_theme/issues/98#issuecomment-1503211439
app.config.html_permalinks_icon = "¶"


def setup(app: Sphinx):
def setup(app: Sphinx) -> None:
"""Register theme."""
app.add_html_theme("kedro-sphinx-theme", THEME_PATH)
app.add_html_theme("kedro-sphinx-theme", THEME_PATH.as_posix())

app.connect("builder-inited", _add_jinja_filters)
app.connect("builder-inited", _override_permalinks_icon)

0 comments on commit a7f904f

Please sign in to comment.