from albatross import SimpleContext class Node: def __init__(self, name, children = None): self.name = name if children is not None: self.children = children ctx = SimpleContext('.') ctx.locals.tree = Node('a', [Node('b', [Node('c'), Node('d')]), Node('e', [Node('f', [Node('g', [Node('h'), Node('i')])]), Node('j'), Node('k', [Node('l'), Node('m')])])]) templ = ctx.load_template('tree.html') templ.to_html(ctx) ctx.flush_content()