heroweb/lib/webcomponents/timeline/render.py

17 lines
533 B
Python
Raw Normal View History

2024-09-11 19:19:48 +00:00
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