From a1c2d6a3e6547c7e2c0120bd555dfc6288a8b92a Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Sun, 7 Jul 2024 13:21:19 +0100 Subject: [PATCH] refactor(render): Remove `ge` in fa of smaller methods --- adr_viewer/__init__.py | 5 +++-- adr_viewer/render.py | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/adr_viewer/__init__.py b/adr_viewer/__init__.py index 1ada241..fa9e712 100644 --- a/adr_viewer/__init__.py +++ b/adr_viewer/__init__.py @@ -7,7 +7,6 @@ generate_configuration, render_html, AdrTemplateConfig, - generate_content, ) from adr_viewer.server import run_server @@ -24,7 +23,9 @@ def main(adr_path, output, title, serve, port, template_dir) -> None: adrs: List[Adr] = parse_adr_files("%s/*.md" % adr_path) - content = generate_content(adrs, template_dir, title) + configuration = generate_configuration(adrs, title) + + content = render_html(configuration, template_dir) if serve: run_server(content, port) diff --git a/adr_viewer/render.py b/adr_viewer/render.py index 4ab13e3..d421797 100644 --- a/adr_viewer/render.py +++ b/adr_viewer/render.py @@ -45,7 +45,3 @@ def generate_configuration(adrs: List[Adr], title=None): config.records.append(adr) return config - - -def generate_content(adrs: List[Adr], template_dir_override=None, title=None) -> str: - return render_html(generate_configuration(adrs, title), template_dir_override)