diff --git a/jupyterlite_sphinx/jupyterlite_sphinx.py b/jupyterlite_sphinx/jupyterlite_sphinx.py index 08029b9..9385165 100644 --- a/jupyterlite_sphinx/jupyterlite_sphinx.py +++ b/jupyterlite_sphinx/jupyterlite_sphinx.py @@ -4,7 +4,7 @@ import shutil import glob import re -from typing import Dict, Any +from typing import Dict, Any, List from pathlib import Path @@ -608,9 +608,9 @@ def run(self): return [content_container_node, notebook_container, script_node] -def _process_docstring_examples(app, docname, source): - source_path = app.env.doc2path(docname) - if source_path.endswith(".py"): +def _process_docstring_examples(app: Sphinx, docname: str, source: List[str]) -> None: + source_path: str = app.env.doc2path(docname) + if source_path.suffix == ".py": source[0] = insert_try_examples_directive(source[0])