Skip to content

Commit

Permalink
update soem typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Sep 27, 2023
1 parent 88c43bc commit ee1ae89
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions papyri/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -1120,7 +1122,7 @@ def old_render_one(
store: GraphStore,
template,
doc: IngestedBlobs,
qa,
qa: str,
*,
current_type,
backrefs,
Expand Down

0 comments on commit ee1ae89

Please sign in to comment.