Initial commit: CodeMap v0.1.0 - CLI tool for code analysis and diagram generation
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-01-30 12:19:06 +00:00
parent 57a8700954
commit 8e73f1e440

View File

@@ -0,0 +1,21 @@
import os
from jinja2 import Environment, FileSystemLoader
def get_template(template_name: str) -> str:
templates_dir = os.path.dirname(__file__)
env = Environment(loader=FileSystemLoader(templates_dir))
template = env.get_template(template_name)
return template.render()
def render_html(mermaid_content: str, title: str = "Code Map", auto_refresh: bool = False, refresh_interval: int = 5) -> str:
templates_dir = os.path.dirname(__file__)
env = Environment(loader=FileSystemLoader(templates_dir))
template = env.get_template("viewer.html")
return template.render(
mermaid_content=mermaid_content,
title=title,
auto_refresh=auto_refresh,
refresh_interval=refresh_interval
)