mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-23 03:06:55 -04:00
refactor: Move indexing logic out of logging module
This commit is contained in:
parent
1b1b9d8519
commit
fa5de72f9f
5 changed files with 40 additions and 37 deletions
|
@ -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"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue