Current section
Files
Jump to
Current section
Files
src/html_dsl.erl
-module(html_dsl).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-spec main() -> nil.
main() ->
_pipe@24 = html_dsl@types@html:html(
<<"en"/utf8>>,
begin
_pipe = html_dsl@types@html@head:head(),
_pipe@1 = html_dsl@types@html@head:title(
_pipe,
<<"Hello, Gleam!"/utf8>>
),
_pipe@2 = html_dsl@types@html@head:charset(
_pipe@1,
<<"UTF-8"/utf8>>
),
_pipe@3 = html_dsl@types@html@head:meta(
_pipe@2,
<<"viewport"/utf8>>,
<<"width=device-width, initial-scale=1.0"/utf8>>
),
_pipe@4 = html_dsl@types@html@head:meta(
_pipe@3,
<<"description"/utf8>>,
<<"A Gleam program that generates HTML."/utf8>>
),
_pipe@5 = html_dsl@types@html@head:script(
_pipe@4,
<<"https://cdn.tailwindcss.com"/utf8>>
),
html_dsl@types@html@head:'end'(_pipe@5)
end,
html_dsl@types@html:body(
begin
_pipe@6 = html_dsl@types@attribute:id(
none,
<<"main-content"/utf8>>
),
html_dsl@types@attribute:class(
_pipe@6,
<<"bg-black text-white"/utf8>>
)
end,
<<<<<<(html_dsl@types@html:header(
html_dsl@types@attribute:class(
none,
<<"grid place-content-center"/utf8>>
),
html_dsl@types@html:nav(none, <<"Hello"/utf8>>)
))/binary,
(case false of
true ->
html_dsl@types@html:h1(none, <<"True"/utf8>>);
false ->
html_dsl@types@html:h1(none, <<"False"/utf8>>)
end)/binary>>/binary,
(begin
_pipe@7 = html_dsl@types@html@lists:ul(none),
_pipe@9 = html_dsl@types@html@lists:add(
_pipe@7,
begin
_pipe@8 = html_dsl@types@attribute:new(),
html_dsl@types@attribute:class(
_pipe@8,
<<"text-blue-400"/utf8>>
)
end,
<<"This is a list item"/utf8>>
),
_pipe@10 = html_dsl@types@html@lists:add(
_pipe@9,
none,
<<"This is another list item"/utf8>>
),
html_dsl@types@html@lists:'end'(_pipe@10)
end)/binary>>/binary,
(begin
_pipe@13 = html_dsl@types@html@form:form(
begin
_pipe@11 = html_dsl@types@attribute:class(
none,
<<"flex"/utf8>>
),
_pipe@12 = html_dsl@types@attribute:add(
_pipe@11,
<<"method"/utf8>>,
<<"GET"/utf8>>
),
html_dsl@types@attribute:add(
_pipe@12,
<<"action"/utf8>>,
<<"#"/utf8>>
)
end
),
_pipe@14 = html_dsl@types@html@form:label(
_pipe@13,
none,
<<"Name:"/utf8>>
),
_pipe@15 = html_dsl@types@html@form:input(
_pipe@14,
none,
text,
<<"name"/utf8>>
),
_pipe@16 = html_dsl@types@html@form:input(
_pipe@15,
none,
submit,
<<"submit"/utf8>>
),
_pipe@17 = html_dsl@types@html@form:element(
_pipe@16,
html_dsl@types@html:button(none, <<"Click me!"/utf8>>)
),
_pipe@18 = html_dsl@types@html@form@select:select(
_pipe@17,
none
),
_pipe@20 = html_dsl@types@html@form@select:add(
_pipe@18,
begin
_pipe@19 = html_dsl@types@attribute:add(
none,
<<"selected"/utf8>>,
<<"selected"/utf8>>
),
html_dsl@types@attribute:add(
_pipe@19,
<<"disabled"/utf8>>,
<<"disabled"/utf8>>
)
end,
<<""/utf8>>,
<<"--Please choose an option--"/utf8>>
),
_pipe@21 = html_dsl@types@html@form@select:add(
_pipe@20,
none,
<<"something"/utf8>>,
<<"Something"/utf8>>
),
_pipe@22 = html_dsl@types@html@form@select:add(
_pipe@21,
none,
<<"else"/utf8>>,
<<"Else"/utf8>>
),
_pipe@23 = html_dsl@types@html@form@select:'end'(_pipe@22),
html_dsl@types@html@form:'end'(_pipe@23)
end)/binary>>
)
),
_pipe@25 = html_dsl@types@html:force(_pipe@24),
_pipe@26 = html_dsl@types@html:html_to_string(_pipe@25),
gleam@io:println(_pipe@26).