Skip to content

Commit

Permalink
mypy: Use correct type for HTML visitor functions (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Mar 8, 2024
2 parents 6f55fae + 96eccd1 commit 0170bc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sphinxcontrib/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from sphinx.environment import BuildEnvironment
from sphinx.util import logging
from sphinx.util.docutils import SphinxDirective, SphinxTranslator
from sphinx.writers.html import HTMLTranslator

__author__ = "Raphael Massabot"
__version__ = "0.2.0"
Expand Down Expand Up @@ -148,7 +149,7 @@ def run(self) -> List[video_node]:
]


def visit_video_node_html(translator: SphinxTranslator, node: video_node) -> None:
def visit_video_node_html(translator: HTMLTranslator, node: video_node) -> None:
"""Entry point of the html video node."""
# start the video block
attr: List[str] = [f'{k}="{node[k]}"' for k in SUPPORTED_OPTIONS if node[k]]
Expand All @@ -168,7 +169,7 @@ def visit_video_node_html(translator: SphinxTranslator, node: video_node) -> Non
translator.body.append(html)


def depart_video_node_html(translator: SphinxTranslator, node: video_node) -> None:
def depart_video_node_html(translator: HTMLTranslator, node: video_node) -> None:
"""Exit of the html video node."""
translator.body.append("</video>")

Expand Down

0 comments on commit 0170bc9

Please sign in to comment.