refactor: Move indexing logic out of logging module

This commit is contained in:
Cristian 2020-11-28 12:28:39 -05:00
parent 1b1b9d8519
commit fa5de72f9f
5 changed files with 40 additions and 37 deletions

View file

@ -50,6 +50,13 @@ def parse_html_main_index(out_dir: Path=OUTPUT_DIR) -> Iterator[str]:
return ()
def generate_index_from_links(links: List[Link], with_headers: bool):
if with_headers:
output = main_index_template(links, True)
else:
output = main_index_template(links, True, MINIMAL_INDEX_TEMPLATE)
return output
@enforce_types
def main_index_template(links: List[Link], template: str=MAIN_INDEX_TEMPLATE) -> str:
"""render the template for the entire main index"""