Packages
WebAssembly is a web DSL for Elixir. You create html structure straight using do blocks. Means, you can intermix html-building blocks with full Elixir syntax. DSL output is an iolist, which you can flatten to string, but better use is to just feed it to the socket (via Plug & Cowboy). WebAssem...
Current section
Files
Jump to
Current section
Files
lib/examples/simple.ex
defmodule WebAssembly.Examples do
# needed to have examples as a separate module
# to trigger dialyzer analysis of core & dsl
defp all_goes_well, do: true
def readme_ex do
use WebAssembly
builder do
html do
head do
ctype = "text/html"
meta http_equiv: "Content-Type", content: ctype
title "foo"
end
body do
div class: "mydiv" do
ul do
li 1
if all_goes_well, do:
li "second"
end
end
text "that was nice"
end
end
end
end
end