// html-page.el — Example of native HTML template syntax in El. // // El HTML templates let you write HTML directly in expression position. // Interpolated values are automatically HTML-escaped. // Use raw(expr) to bypass escaping when you know the content is safe. // // Compile and run: // ./dist/platform/elc examples/html-page.el > /tmp/html-page.c // cc -std=c11 -I el-compiler/runtime -lcurl -lpthread \ // -o /tmp/html-page /tmp/html-page.c el-compiler/runtime/el_runtime.c // /tmp/html-page fn render_item(item: String) -> String { return
Built with El HTML templates
} fn main() -> Void { let items: [String] = ["Lexer", "Parser", "Codegen", "Runtime"] let page: String = render_page("El Compiler Stages", items) println(page) }