justjavac/template_examples/list does not have a README file

    TodoItem

    pub(all) struct TodoItem {
    title : String
    done : Bool
    }

    A single todo item rendered by the list example.

    title is escaped by the template, and done controls whether the item is displayed as completed.

    TodoList

    pub(all) struct TodoList {
    title : String
    items : Array[TodoItem]
    }

    Todo list data passed into the page template.

    The list template uses title as a heading and iterates over items to demonstrate MoonBit statements embedded in template files.

    TodoListPage

    pub(all) struct TodoListPage {
    list : TodoList
    }

    Data model bound to templates/list.mtpl.

    Keeping the page wrapper separate from TodoList mirrors the shape used by applications that pass view-specific state into a generated renderer.

    empty_page

    fn empty_page() -> TodoListPage

    Builds an empty todo-list page for tests of the fallback branch.

    This keeps the empty-state scenario easy to exercise without duplicating setup code in each test.

    render_demo

    fn render_demo() -> String raise

    Renders the populated todo-list example.

    main prints this value, and tests call it directly.

    sample_page

    fn sample_page() -> TodoListPage

    Builds the populated todo-list page used by the runnable example.

    The values are intentionally stable so tests can assert the rendered output.