heroweb/lib/webcomponents/timeline/render.py
2024-09-11 22:19:48 +03:00

17 lines
533 B
Python

from jinja2 import Environment, FileSystemLoader
from webcomponents.timeline_white.model import TimeLine
def render(timeline_id: int) -> str:
# Create an agenda instance
timeline = TimeLine(example=True) # timeline_id=timeline_id
# Set up Jinja2 environment and load the template
env = Environment(loader=FileSystemLoader(searchpath='./templates'))
template = env.get_template('timeline.html')
# Render the template with the agenda data
output = template.render(timeline=timeline)
return output