import std/html.{type Element, type Html, raw}
import std/io
import std/list
pub type Post { Post(title: String, likes: Int, draft: Bool) }
fn badge :: label: String children: List> -> Element
{
{children}
}
fn post_view :: p: Post -> Html
{
{p.title}
{show p.likes}
}
pub fn page :: posts: List -> Html
{
Posts & "news"
{list.map posts post_view}
<>
a b c
{raw "trusted"}
>
}
pub fn main :: -> () /
{
io.println
( html.render
(page [Post("Hello ", 3, False), Post("Draft", 0, True)])
)
}
//> Posts & "news"
a b c
trusted