Skip to content

Commit

Permalink
refactor(render): Remove generate_content in favour of smaller methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwilson committed Jul 7, 2024
1 parent e5638c6 commit 891c43d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions adr_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
generate_configuration,
render_html,
AdrTemplateConfig,
generate_content,
)
from adr_viewer.server import run_server

Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions adr_viewer/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 891c43d

Please sign in to comment.