Something went wrong. Try again.
A component based functional template language
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132/* Some Comment Eiusmod eiusmod tempor eiusmod nostrud nostrud nostrud in nisi ipsum ullamco ipsum esse enim laborum cupidatat. Deserunt duis culpa consectetur est duis.*/template Docs(label: "Docs", icon: "/images/icons/page-docs.svg") { /* Another comment! */ let fruits = ["apples", "oranges", "bannanas", "melons"];
let calculations = { math: 5 / 3 + 5 * 7, math2: (3 + 5) / 5 * 7, math3?: if (false) 3 * 4, };
<> <span /> <> <div class="foo" /> </> <ul> {for (fruit in fruits) { <li>{fruit}</li> }} </ul> <code>{"Aliqua in elit sunt in anim culpa nostrud elit.Elit voluptate nisi laborum est eu esse non exercitation minim.Nisi ea enim minim quis."}</code> </>}
/* Some Comment Eiusmod eiusmod tempor eiusmod nostrud nostrud nostrud in nisi ipsum ullamco ipsum esse enim laborum cupidatat. Deserunt duis culpa consectetur est duis.*/template Component( label: "Long Name of $(c)", icon: "/images/icons/page-docs.svg", groups: ["Some Group", "Another Group", "And another group"],) { #Portal(key: "stylesheets", push: <link rel="stylesheet" href="/css/ButtonPrimary.css" />);
let fruits = #Array(key: "fruits", of: #String);
let tag? = #Selection( label: "SEO Tag", options: [ { label: "h1", value: "h1", }, { label: "h2", value: "h2", }, { label: "h3", value: "h3", }, { label: "h4", value: "h4", }, { label: "h5", value: "h5", }, { label: "h6", value: "h6", }, ], ) |> Base:Fn.default("h1");
let tags = #Array(label: "Tags", initialSize: 1, max: 5, of: #String(label: "Tag"));
<> <span /> <> <div class="foo" /> </> <ul> {for (fruit in Base:Array.rev(fruits)) { let prefix = "fruit:"; <li>{prefix} {fruit}</li> }} </ul> <a class="test $(class)" href={href} title={title} target={target} rel={if (target == "_blank") "noopener" else ""}> {content} </a> <img style="width: 100%; height: auto;" width={image.width} height={image.height} src={image.src} alt={image.alt} /> <p> {/* A Template Comment */} Aliqua in elit sunt in anim culpa nostrud elit. Elit voluptate nisi laborum est eu esse non exercitation minim. Nisi ea enim minim quis. </p> </>}
library NoAttributes { <div />}
template Mutation { let mutable a = "initial"; a := "mutated";
let mutable b = "initial"; if (a == "mutated") { b := "mutated"; };
let mutable c = "initial"; let print_c = fn () -> c; c := "mutated";
let mutable d = "initial"; let print_d = fn () -> d; let mutable d = "initial2"; d := "mutated";
<section class="foo" data-test="bar"> a: {a} b: {b} print_c(): {print_c()} print_d(): {print_d()} </section>}