import os from jinja2 import Environment, FileSystemLoader from webcomponents.main.model_view import example def render(timeline_id: int = 0) -> str: # Create an agenda instance mydoc = example() # Set up Jinja2 environment and load the template base_dir = os.path.dirname(__file__) env = Environment( loader=FileSystemLoader(searchpath=f'{base_dir}/templates') ) # pudb.set_trace() template = env.get_template('index.html') # Render the template with the agenda data output = template.render(doc=mydoc) print(output) return output