diff --git a/papyri/render.py b/papyri/render.py index 94c7e907..3435895c 100644 --- a/papyri/render.py +++ b/papyri/render.py @@ -42,7 +42,7 @@ CSS_DATA = HtmlFormatter(style="pastie").get_style_defs(".highlight") -def minify(s): +def minify(s: str) -> str: return minify_html.minify( s, minify_js=True, remove_processing_instructions=True, keep_closing_tags=True ) @@ -63,7 +63,7 @@ def get_source(self, *args, **kwargs): return until_ruler(source), filename, uptodate -def until_ruler(doc): +def until_ruler(doc: str) -> str: """ Utilities to clean jinja template; @@ -98,9 +98,11 @@ def until_ruler(doc): # doable after purely as frontend thing. -def compute_siblings_II(ref, family: set): +def compute_siblings_II( + ref: str, family: Set[RefInfo] +) -> Dict[str, List[Tuple[str, str]]]: """ """ - from collections import defaultdict + assert isinstance(ref, str) module_versions = defaultdict(lambda: set()) for f in family: @@ -131,7 +133,7 @@ def compute_siblings_II(ref, family: set): return siblings -def make_tree(names): +def make_tree(names: List[str]): rd = lambda: defaultdict(rd) tree = defaultdict(rd) @@ -1120,7 +1122,7 @@ def old_render_one( store: GraphStore, template, doc: IngestedBlobs, - qa, + qa: str, *, current_type, backrefs,