Current section

Files

Jump to
nakai src nakai@html.erl
Raw

src/nakai@html.erl

-module(nakai@html).
-compile(no_auto_import).
-export([doctype/1, space/0, a/2, body/2, 'div'/2, head/2, html/2, h1/2, h2/2, h3/2, h4/2, h5/2, h6/2, img/1, li/2, link/1, ol/2, p/2, section/2, title/1, ul/2, hr/1, pre/2, blockquote/2, span/2, code/2, em/2, strong/2, i/2, b/2, u/2, sub/2, sup/2, br/1, dl/2, dt/2, dd/2, iframe/2, canvas/2, math/2, form/2, input/1, textarea/2, button/2, select/2, option/2, nav/2, article/2, aside/2, header/2, footer/2, main/2, figure/2, figcaption/2, table/2, colgroup/2, col/2, tbody/2, thead/2, tfoot/2, td/2, th/2, fieldset/2, legend/2, label/2, datalist/2, optgroup/2, output/2, progress/2, meter/2, audio/2, video/2, source/2, track/2, embed/2, object/2, param/2, ins/2, del/2, small/2, cite/2, dfn/2, abbr/2, time/2, var/2, samp/2, kbd/2, s/2, q/2, mark/2, ruby/2, rt/2, rp/2, bdi/2, bdo/2, wbr/2, details/2, summary/2, menuitem/2, menu/2]).
-export_type([node_/1]).
-type node_(EIR) :: {head, list(node_(EIR))} |
{comment, binary()} |
{element, binary(), list(nakai@html@attrs:attr(EIR)), list(node_(EIR))} |
{leaf_element, binary(), list(nakai@html@attrs:attr(EIR))} |
{text, binary()} |
{component, fun(() -> node_(EIR))} |
{fragment, list(node_(EIR))} |
nothing.
-spec doctype(binary()) -> nakai@html@doctype:doctype().
doctype(Decl) ->
{doctype, Decl}.
-spec space() -> node_(any()).
space() ->
{text, <<" "/utf8>>}.
-spec a(list(nakai@html@attrs:attr(EJB)), list(node_(EJB))) -> node_(EJB).
a(Attrs, Children) ->
{element, <<"a"/utf8>>, Attrs, Children}.
-spec body(list(nakai@html@attrs:attr(EJH)), list(node_(EJH))) -> node_(EJH).
body(Attrs, Children) ->
{element, <<"body"/utf8>>, Attrs, Children}.
-spec 'div'(list(nakai@html@attrs:attr(EJN)), list(node_(EJN))) -> node_(EJN).
'div'(Attrs, Children) ->
{element, <<"div"/utf8>>, Attrs, Children}.
-spec head(list(nakai@html@attrs:attr(EJT)), list(node_(EJT))) -> node_(EJT).
head(_, Children) ->
{head, Children}.
-spec html(list(nakai@html@attrs:attr(EJZ)), list(node_(EJZ))) -> node_(EJZ).
html(Attrs, Children) ->
{element, <<"html"/utf8>>, Attrs, Children}.
-spec h1(list(nakai@html@attrs:attr(EKF)), list(node_(EKF))) -> node_(EKF).
h1(Attrs, Children) ->
{element, <<"h1"/utf8>>, Attrs, Children}.
-spec h2(list(nakai@html@attrs:attr(EKL)), list(node_(EKL))) -> node_(EKL).
h2(Attrs, Children) ->
{element, <<"h2"/utf8>>, Attrs, Children}.
-spec h3(list(nakai@html@attrs:attr(EKR)), list(node_(EKR))) -> node_(EKR).
h3(Attrs, Children) ->
{element, <<"h3"/utf8>>, Attrs, Children}.
-spec h4(list(nakai@html@attrs:attr(EKX)), list(node_(EKX))) -> node_(EKX).
h4(Attrs, Children) ->
{element, <<"h4"/utf8>>, Attrs, Children}.
-spec h5(list(nakai@html@attrs:attr(ELD)), list(node_(ELD))) -> node_(ELD).
h5(Attrs, Children) ->
{element, <<"h5"/utf8>>, Attrs, Children}.
-spec h6(list(nakai@html@attrs:attr(ELJ)), list(node_(ELJ))) -> node_(ELJ).
h6(Attrs, Children) ->
{element, <<"h6"/utf8>>, Attrs, Children}.
-spec img(list(nakai@html@attrs:attr(ELP))) -> node_(ELP).
img(Attrs) ->
{leaf_element, <<"img"/utf8>>, Attrs}.
-spec li(list(nakai@html@attrs:attr(ELT)), list(node_(ELT))) -> node_(ELT).
li(Attrs, Children) ->
{element, <<"li"/utf8>>, Attrs, Children}.
-spec link(list(nakai@html@attrs:attr(ELZ))) -> node_(ELZ).
link(Attrs) ->
{leaf_element, <<"link"/utf8>>, Attrs}.
-spec ol(list(nakai@html@attrs:attr(EMD)), list(node_(EMD))) -> node_(EMD).
ol(Attrs, Children) ->
{element, <<"ol"/utf8>>, Attrs, Children}.
-spec p(list(nakai@html@attrs:attr(EMJ)), list(node_(EMJ))) -> node_(EMJ).
p(Attrs, Children) ->
{element, <<"p"/utf8>>, Attrs, Children}.
-spec section(list(nakai@html@attrs:attr(EMP)), list(node_(EMP))) -> node_(EMP).
section(Attrs, Children) ->
{element, <<"section"/utf8>>, Attrs, Children}.
-spec title(binary()) -> node_(any()).
title(Title) ->
{element, <<"title"/utf8>>, [], [{text, Title}]}.
-spec ul(list(nakai@html@attrs:attr(EMX)), list(node_(EMX))) -> node_(EMX).
ul(Attrs, Children) ->
{element, <<"ul"/utf8>>, Attrs, Children}.
-spec hr(list(nakai@html@attrs:attr(END))) -> node_(END).
hr(Attrs) ->
{leaf_element, <<"hr"/utf8>>, Attrs}.
-spec pre(list(nakai@html@attrs:attr(ENH)), list(node_(ENH))) -> node_(ENH).
pre(Attrs, Children) ->
{element, <<"pre"/utf8>>, Attrs, Children}.
-spec blockquote(list(nakai@html@attrs:attr(ENN)), list(node_(ENN))) -> node_(ENN).
blockquote(Attrs, Children) ->
{element, <<"blockquote"/utf8>>, Attrs, Children}.
-spec span(list(nakai@html@attrs:attr(ENT)), list(node_(ENT))) -> node_(ENT).
span(Attrs, Children) ->
{element, <<"span"/utf8>>, Attrs, Children}.
-spec code(list(nakai@html@attrs:attr(ENZ)), list(node_(ENZ))) -> node_(ENZ).
code(Attrs, Children) ->
{element, <<"code"/utf8>>, Attrs, Children}.
-spec em(list(nakai@html@attrs:attr(EOF)), list(node_(EOF))) -> node_(EOF).
em(Attrs, Children) ->
{element, <<"em"/utf8>>, Attrs, Children}.
-spec strong(list(nakai@html@attrs:attr(EOL)), list(node_(EOL))) -> node_(EOL).
strong(Attrs, Children) ->
{element, <<"strong"/utf8>>, Attrs, Children}.
-spec i(list(nakai@html@attrs:attr(EOR)), list(node_(EOR))) -> node_(EOR).
i(Attrs, Children) ->
{element, <<"i"/utf8>>, Attrs, Children}.
-spec b(list(nakai@html@attrs:attr(EOX)), list(node_(EOX))) -> node_(EOX).
b(Attrs, Children) ->
{element, <<"b"/utf8>>, Attrs, Children}.
-spec u(list(nakai@html@attrs:attr(EPD)), list(node_(EPD))) -> node_(EPD).
u(Attrs, Children) ->
{element, <<"u"/utf8>>, Attrs, Children}.
-spec sub(list(nakai@html@attrs:attr(EPJ)), list(node_(EPJ))) -> node_(EPJ).
sub(Attrs, Children) ->
{element, <<"sub"/utf8>>, Attrs, Children}.
-spec sup(list(nakai@html@attrs:attr(EPP)), list(node_(EPP))) -> node_(EPP).
sup(Attrs, Children) ->
{element, <<"sup"/utf8>>, Attrs, Children}.
-spec br(list(nakai@html@attrs:attr(EPV))) -> node_(EPV).
br(Attrs) ->
{leaf_element, <<"br"/utf8>>, Attrs}.
-spec dl(list(nakai@html@attrs:attr(EPZ)), list(node_(EPZ))) -> node_(EPZ).
dl(Attrs, Children) ->
{element, <<"dl"/utf8>>, Attrs, Children}.
-spec dt(list(nakai@html@attrs:attr(EQF)), list(node_(EQF))) -> node_(EQF).
dt(Attrs, Children) ->
{element, <<"dt"/utf8>>, Attrs, Children}.
-spec dd(list(nakai@html@attrs:attr(EQL)), list(node_(EQL))) -> node_(EQL).
dd(Attrs, Children) ->
{element, <<"dd"/utf8>>, Attrs, Children}.
-spec iframe(list(nakai@html@attrs:attr(EQR)), list(node_(EQR))) -> node_(EQR).
iframe(Attrs, Children) ->
{element, <<"iframe"/utf8>>, Attrs, Children}.
-spec canvas(list(nakai@html@attrs:attr(EQX)), list(node_(EQX))) -> node_(EQX).
canvas(Attrs, Children) ->
{element, <<"canvas"/utf8>>, Attrs, Children}.
-spec math(list(nakai@html@attrs:attr(ERD)), list(node_(ERD))) -> node_(ERD).
math(Attrs, Children) ->
{element, <<"math"/utf8>>, Attrs, Children}.
-spec form(list(nakai@html@attrs:attr(ERJ)), list(node_(ERJ))) -> node_(ERJ).
form(Attrs, Children) ->
{element, <<"form"/utf8>>, Attrs, Children}.
-spec input(list(nakai@html@attrs:attr(ERP))) -> node_(ERP).
input(Attrs) ->
{leaf_element, <<"dl"/utf8>>, Attrs}.
-spec textarea(list(nakai@html@attrs:attr(ERT)), list(node_(ERT))) -> node_(ERT).
textarea(Attrs, Children) ->
{element, <<"textarea"/utf8>>, Attrs, Children}.
-spec button(list(nakai@html@attrs:attr(ERZ)), list(node_(ERZ))) -> node_(ERZ).
button(Attrs, Children) ->
{element, <<"button"/utf8>>, Attrs, Children}.
-spec select(list(nakai@html@attrs:attr(ESF)), list(node_(ESF))) -> node_(ESF).
select(Attrs, Children) ->
{element, <<"select"/utf8>>, Attrs, Children}.
-spec option(list(nakai@html@attrs:attr(ESL)), list(node_(ESL))) -> node_(ESL).
option(Attrs, Children) ->
{element, <<"option"/utf8>>, Attrs, Children}.
-spec nav(list(nakai@html@attrs:attr(ESR)), list(node_(ESR))) -> node_(ESR).
nav(Attrs, Children) ->
{element, <<"nav"/utf8>>, Attrs, Children}.
-spec article(list(nakai@html@attrs:attr(ESX)), list(node_(ESX))) -> node_(ESX).
article(Attrs, Children) ->
{element, <<"article"/utf8>>, Attrs, Children}.
-spec aside(list(nakai@html@attrs:attr(ETD)), list(node_(ETD))) -> node_(ETD).
aside(Attrs, Children) ->
{element, <<"aside"/utf8>>, Attrs, Children}.
-spec header(list(nakai@html@attrs:attr(ETJ)), list(node_(ETJ))) -> node_(ETJ).
header(Attrs, Children) ->
{element, <<"header"/utf8>>, Attrs, Children}.
-spec footer(list(nakai@html@attrs:attr(ETP)), list(node_(ETP))) -> node_(ETP).
footer(Attrs, Children) ->
{element, <<"footer"/utf8>>, Attrs, Children}.
-spec main(list(nakai@html@attrs:attr(ETV)), list(node_(ETV))) -> node_(ETV).
main(Attrs, Children) ->
{element, <<"main"/utf8>>, Attrs, Children}.
-spec figure(list(nakai@html@attrs:attr(EUB)), list(node_(EUB))) -> node_(EUB).
figure(Attrs, Children) ->
{element, <<"figure"/utf8>>, Attrs, Children}.
-spec figcaption(list(nakai@html@attrs:attr(EUH)), list(node_(EUH))) -> node_(EUH).
figcaption(Attrs, Children) ->
{element, <<"figcaption"/utf8>>, Attrs, Children}.
-spec table(list(nakai@html@attrs:attr(EUN)), list(node_(EUN))) -> node_(EUN).
table(Attrs, Children) ->
{element, <<"table"/utf8>>, Attrs, Children}.
-spec colgroup(list(nakai@html@attrs:attr(EUT)), list(node_(EUT))) -> node_(EUT).
colgroup(Attrs, Children) ->
{element, <<"colgroup"/utf8>>, Attrs, Children}.
-spec col(list(nakai@html@attrs:attr(EUZ)), list(node_(EUZ))) -> node_(EUZ).
col(Attrs, Children) ->
{element, <<"col"/utf8>>, Attrs, Children}.
-spec tbody(list(nakai@html@attrs:attr(EVF)), list(node_(EVF))) -> node_(EVF).
tbody(Attrs, Children) ->
{element, <<"tbody"/utf8>>, Attrs, Children}.
-spec thead(list(nakai@html@attrs:attr(EVL)), list(node_(EVL))) -> node_(EVL).
thead(Attrs, Children) ->
{element, <<"thead"/utf8>>, Attrs, Children}.
-spec tfoot(list(nakai@html@attrs:attr(EVR)), list(node_(EVR))) -> node_(EVR).
tfoot(Attrs, Children) ->
{element, <<"tfoot"/utf8>>, Attrs, Children}.
-spec td(list(nakai@html@attrs:attr(EVX)), list(node_(EVX))) -> node_(EVX).
td(Attrs, Children) ->
{element, <<"td"/utf8>>, Attrs, Children}.
-spec th(list(nakai@html@attrs:attr(EWD)), list(node_(EWD))) -> node_(EWD).
th(Attrs, Children) ->
{element, <<"th"/utf8>>, Attrs, Children}.
-spec fieldset(list(nakai@html@attrs:attr(EWJ)), list(node_(EWJ))) -> node_(EWJ).
fieldset(Attrs, Children) ->
{element, <<"fieldset"/utf8>>, Attrs, Children}.
-spec legend(list(nakai@html@attrs:attr(EWP)), list(node_(EWP))) -> node_(EWP).
legend(Attrs, Children) ->
{element, <<"legend"/utf8>>, Attrs, Children}.
-spec label(list(nakai@html@attrs:attr(EWV)), list(node_(EWV))) -> node_(EWV).
label(Attrs, Children) ->
{element, <<"label"/utf8>>, Attrs, Children}.
-spec datalist(list(nakai@html@attrs:attr(EXB)), list(node_(EXB))) -> node_(EXB).
datalist(Attrs, Children) ->
{element, <<"datalist"/utf8>>, Attrs, Children}.
-spec optgroup(list(nakai@html@attrs:attr(EXH)), list(node_(EXH))) -> node_(EXH).
optgroup(Attrs, Children) ->
{element, <<"optgroup"/utf8>>, Attrs, Children}.
-spec output(list(nakai@html@attrs:attr(EXN)), list(node_(EXN))) -> node_(EXN).
output(Attrs, Children) ->
{element, <<"output"/utf8>>, Attrs, Children}.
-spec progress(list(nakai@html@attrs:attr(EXT)), list(node_(EXT))) -> node_(EXT).
progress(Attrs, Children) ->
{element, <<"progress"/utf8>>, Attrs, Children}.
-spec meter(list(nakai@html@attrs:attr(EXZ)), list(node_(EXZ))) -> node_(EXZ).
meter(Attrs, Children) ->
{element, <<"meter"/utf8>>, Attrs, Children}.
-spec audio(list(nakai@html@attrs:attr(EYF)), list(node_(EYF))) -> node_(EYF).
audio(Attrs, Children) ->
{element, <<"audio"/utf8>>, Attrs, Children}.
-spec video(list(nakai@html@attrs:attr(EYL)), list(node_(EYL))) -> node_(EYL).
video(Attrs, Children) ->
{element, <<"video"/utf8>>, Attrs, Children}.
-spec source(list(nakai@html@attrs:attr(EYR)), list(node_(EYR))) -> node_(EYR).
source(Attrs, Children) ->
{element, <<"source"/utf8>>, Attrs, Children}.
-spec track(list(nakai@html@attrs:attr(EYX)), list(node_(EYX))) -> node_(EYX).
track(Attrs, Children) ->
{element, <<"track"/utf8>>, Attrs, Children}.
-spec embed(list(nakai@html@attrs:attr(EZD)), list(node_(EZD))) -> node_(EZD).
embed(Attrs, Children) ->
{element, <<"embed"/utf8>>, Attrs, Children}.
-spec object(list(nakai@html@attrs:attr(EZJ)), list(node_(EZJ))) -> node_(EZJ).
object(Attrs, Children) ->
{element, <<"object"/utf8>>, Attrs, Children}.
-spec param(list(nakai@html@attrs:attr(EZP)), list(node_(EZP))) -> node_(EZP).
param(Attrs, Children) ->
{element, <<"param"/utf8>>, Attrs, Children}.
-spec ins(list(nakai@html@attrs:attr(EZV)), list(node_(EZV))) -> node_(EZV).
ins(Attrs, Children) ->
{element, <<"ins"/utf8>>, Attrs, Children}.
-spec del(list(nakai@html@attrs:attr(FAB)), list(node_(FAB))) -> node_(FAB).
del(Attrs, Children) ->
{element, <<"del"/utf8>>, Attrs, Children}.
-spec small(list(nakai@html@attrs:attr(FAH)), list(node_(FAH))) -> node_(FAH).
small(Attrs, Children) ->
{element, <<"small"/utf8>>, Attrs, Children}.
-spec cite(list(nakai@html@attrs:attr(FAN)), list(node_(FAN))) -> node_(FAN).
cite(Attrs, Children) ->
{element, <<"cite"/utf8>>, Attrs, Children}.
-spec dfn(list(nakai@html@attrs:attr(FAT)), list(node_(FAT))) -> node_(FAT).
dfn(Attrs, Children) ->
{element, <<"dfn"/utf8>>, Attrs, Children}.
-spec abbr(list(nakai@html@attrs:attr(FAZ)), list(node_(FAZ))) -> node_(FAZ).
abbr(Attrs, Children) ->
{element, <<"abbr"/utf8>>, Attrs, Children}.
-spec time(list(nakai@html@attrs:attr(FBF)), list(node_(FBF))) -> node_(FBF).
time(Attrs, Children) ->
{element, <<"time"/utf8>>, Attrs, Children}.
-spec var(list(nakai@html@attrs:attr(FBL)), list(node_(FBL))) -> node_(FBL).
var(Attrs, Children) ->
{element, <<"var"/utf8>>, Attrs, Children}.
-spec samp(list(nakai@html@attrs:attr(FBR)), list(node_(FBR))) -> node_(FBR).
samp(Attrs, Children) ->
{element, <<"samp"/utf8>>, Attrs, Children}.
-spec kbd(list(nakai@html@attrs:attr(FBX)), list(node_(FBX))) -> node_(FBX).
kbd(Attrs, Children) ->
{element, <<"kbd"/utf8>>, Attrs, Children}.
-spec s(list(nakai@html@attrs:attr(FCD)), list(node_(FCD))) -> node_(FCD).
s(Attrs, Children) ->
{element, <<"s"/utf8>>, Attrs, Children}.
-spec q(list(nakai@html@attrs:attr(FCJ)), list(node_(FCJ))) -> node_(FCJ).
q(Attrs, Children) ->
{element, <<"q"/utf8>>, Attrs, Children}.
-spec mark(list(nakai@html@attrs:attr(FCP)), list(node_(FCP))) -> node_(FCP).
mark(Attrs, Children) ->
{element, <<"mark"/utf8>>, Attrs, Children}.
-spec ruby(list(nakai@html@attrs:attr(FCV)), list(node_(FCV))) -> node_(FCV).
ruby(Attrs, Children) ->
{element, <<"ruby"/utf8>>, Attrs, Children}.
-spec rt(list(nakai@html@attrs:attr(FDB)), list(node_(FDB))) -> node_(FDB).
rt(Attrs, Children) ->
{element, <<"rt"/utf8>>, Attrs, Children}.
-spec rp(list(nakai@html@attrs:attr(FDH)), list(node_(FDH))) -> node_(FDH).
rp(Attrs, Children) ->
{element, <<"rp"/utf8>>, Attrs, Children}.
-spec bdi(list(nakai@html@attrs:attr(FDN)), list(node_(FDN))) -> node_(FDN).
bdi(Attrs, Children) ->
{element, <<"bdi"/utf8>>, Attrs, Children}.
-spec bdo(list(nakai@html@attrs:attr(FDT)), list(node_(FDT))) -> node_(FDT).
bdo(Attrs, Children) ->
{element, <<"bdo"/utf8>>, Attrs, Children}.
-spec wbr(list(nakai@html@attrs:attr(FDZ)), list(node_(FDZ))) -> node_(FDZ).
wbr(Attrs, Children) ->
{element, <<"wbr"/utf8>>, Attrs, Children}.
-spec details(list(nakai@html@attrs:attr(FEF)), list(node_(FEF))) -> node_(FEF).
details(Attrs, Children) ->
{element, <<"details"/utf8>>, Attrs, Children}.
-spec summary(list(nakai@html@attrs:attr(FEL)), list(node_(FEL))) -> node_(FEL).
summary(Attrs, Children) ->
{element, <<"summary"/utf8>>, Attrs, Children}.
-spec menuitem(list(nakai@html@attrs:attr(FER)), list(node_(FER))) -> node_(FER).
menuitem(Attrs, Children) ->
{element, <<"menuitem"/utf8>>, Attrs, Children}.
-spec menu(list(nakai@html@attrs:attr(FEX)), list(node_(FEX))) -> node_(FEX).
menu(Attrs, Children) ->
{element, <<"menu"/utf8>>, Attrs, Children}.