mork_to_lustre
Adds a mork_to_lustre.to_lustre function which takes a mork Document as
argument and outputs a lustre element tree.
gleam add mork mork_to_lustre@1
import mork
import mork/to_lustre
pub fn main() -> Nil {
let markdown = "# Hello, Joe!\n"
let e = markdown |> mork.parse |> to_lustre.to_lustre
let e = e |> element.fragment |> element.to_string
assert e == "<h1>Hello, Joe!</h1>"
}
Further documentation can be found at https://hexdocs.pm/mork_to_lustre.
Development
gleam run # Run the project
gleam test # Run the tests