Current section
Files
Jump to
Current section
Files
src/sprocket@html@attributes.erl
-module(sprocket@html@attributes).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-define(FILEPATH, "src/sprocket/html/attributes.gleam").
-export([attribute/2, media/1, role/1, xmlns/1, xmlns_xlink/1, accept/1, accept_charset/1, action/1, alt/1, async/0, autocapitalize/1, autocomplete/1, autofocus/0, autoplay/0, capture/1, charset/1, checked/0, cite/1, class/1, classes/1, content/1, contenteditable/0, crossorigin/1, defer/0, disabled/0, draggable/0, for/1, formaction/1, height/1, href/1, http_equiv/1, id/1, input_type/1, integrity/1, lang/1, loop/0, method/1, name/1, placeholder/1, preload/0, property/1, readonly/0, referrerpolicy/1, rel/1, selected/0, src/1, style/1, tabindex/1, target/1, title/1, value/1, width/1]).
-file("src/sprocket/html/attributes.gleam", 7).
-spec attribute(binary(), any()) -> sprocket@internal@context:attribute().
attribute(Name, Value) ->
{attribute, Name, gleam_stdlib:identity(Value)}.
-file("src/sprocket/html/attributes.gleam", 11).
-spec media(binary()) -> sprocket@internal@context:attribute().
media(Value) ->
attribute(<<"media"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 15).
-spec role(binary()) -> sprocket@internal@context:attribute().
role(Value) ->
attribute(<<"role"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 19).
-spec xmlns(binary()) -> sprocket@internal@context:attribute().
xmlns(Value) ->
attribute(<<"xmlns"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 23).
-spec xmlns_xlink(binary()) -> sprocket@internal@context:attribute().
xmlns_xlink(Value) ->
attribute(<<"xmlns_xlink"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 27).
-spec accept(binary()) -> sprocket@internal@context:attribute().
accept(Value) ->
attribute(<<"accept"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 31).
-spec accept_charset(binary()) -> sprocket@internal@context:attribute().
accept_charset(Value) ->
attribute(<<"accept-charset"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 35).
-spec action(binary()) -> sprocket@internal@context:attribute().
action(Value) ->
attribute(<<"action"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 39).
-spec alt(binary()) -> sprocket@internal@context:attribute().
alt(Value) ->
attribute(<<"alt"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 43).
-spec async() -> sprocket@internal@context:attribute().
async() ->
attribute(<<"async"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 47).
-spec autocapitalize(binary()) -> sprocket@internal@context:attribute().
autocapitalize(Value) ->
attribute(<<"autocapitalize"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 51).
-spec autocomplete(binary()) -> sprocket@internal@context:attribute().
autocomplete(Value) ->
attribute(<<"autocomplete"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 55).
-spec autofocus() -> sprocket@internal@context:attribute().
autofocus() ->
attribute(<<"autofocus"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 59).
-spec autoplay() -> sprocket@internal@context:attribute().
autoplay() ->
attribute(<<"autoplay"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 63).
-spec capture(binary()) -> sprocket@internal@context:attribute().
capture(Value) ->
attribute(<<"capture"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 67).
-spec charset(binary()) -> sprocket@internal@context:attribute().
charset(Value) ->
attribute(<<"charset"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 71).
-spec checked() -> sprocket@internal@context:attribute().
checked() ->
attribute(<<"checked"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 75).
-spec cite(binary()) -> sprocket@internal@context:attribute().
cite(Value) ->
attribute(<<"cite"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 79).
-spec class(binary()) -> sprocket@internal@context:attribute().
class(Value) ->
attribute(<<"class"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 83).
-spec classes(list(gleam@option:option(binary()))) -> sprocket@internal@context:attribute().
classes(Value) ->
attribute(
<<"class"/utf8>>,
begin
_pipe = gleam@list:fold(
Value,
gleam@string_tree:new(),
fun(Sb, V) -> case V of
none ->
Sb;
{some, V@1} ->
case string:is_empty(Sb) of
true ->
gleam@string_tree:append(Sb, V@1);
false ->
gleam@string_tree:append(
Sb,
<<" "/utf8, V@1/binary>>
)
end
end end
),
unicode:characters_to_binary(_pipe)
end
).
-file("src/sprocket/html/attributes.gleam", 100).
-spec content(binary()) -> sprocket@internal@context:attribute().
content(Value) ->
attribute(<<"content"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 104).
-spec contenteditable() -> sprocket@internal@context:attribute().
contenteditable() ->
attribute(<<"contenteditable"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 108).
-spec crossorigin(binary()) -> sprocket@internal@context:attribute().
crossorigin(Value) ->
attribute(<<"crossorigin"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 112).
-spec defer() -> sprocket@internal@context:attribute().
defer() ->
attribute(<<"defer"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 116).
-spec disabled() -> sprocket@internal@context:attribute().
disabled() ->
attribute(<<"disabled"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 120).
-spec draggable() -> sprocket@internal@context:attribute().
draggable() ->
attribute(<<"draggable"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 124).
-spec for(binary()) -> sprocket@internal@context:attribute().
for(Value) ->
attribute(<<"for"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 128).
-spec formaction(binary()) -> sprocket@internal@context:attribute().
formaction(Value) ->
attribute(<<"formaction"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 132).
-spec height(binary()) -> sprocket@internal@context:attribute().
height(Value) ->
attribute(<<"height"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 136).
-spec href(binary()) -> sprocket@internal@context:attribute().
href(Value) ->
attribute(<<"href"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 140).
-spec http_equiv(binary()) -> sprocket@internal@context:attribute().
http_equiv(Value) ->
attribute(<<"http-equiv"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 144).
-spec id(binary()) -> sprocket@internal@context:attribute().
id(Value) ->
attribute(<<"id"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 148).
-spec input_type(binary()) -> sprocket@internal@context:attribute().
input_type(Value) ->
attribute(<<"type"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 152).
-spec integrity(binary()) -> sprocket@internal@context:attribute().
integrity(Value) ->
attribute(<<"integrity"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 156).
-spec lang(binary()) -> sprocket@internal@context:attribute().
lang(Value) ->
attribute(<<"lang"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 160).
-spec loop() -> sprocket@internal@context:attribute().
loop() ->
attribute(<<"loop"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 164).
-spec method(binary()) -> sprocket@internal@context:attribute().
method(Value) ->
attribute(<<"method"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 168).
-spec name(binary()) -> sprocket@internal@context:attribute().
name(Value) ->
attribute(<<"name"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 172).
-spec placeholder(binary()) -> sprocket@internal@context:attribute().
placeholder(Value) ->
attribute(<<"placeholder"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 176).
-spec preload() -> sprocket@internal@context:attribute().
preload() ->
attribute(<<"preload"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 180).
-spec property(binary()) -> sprocket@internal@context:attribute().
property(Value) ->
attribute(<<"property"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 184).
-spec readonly() -> sprocket@internal@context:attribute().
readonly() ->
attribute(<<"readonly"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 188).
-spec referrerpolicy(binary()) -> sprocket@internal@context:attribute().
referrerpolicy(Value) ->
attribute(<<"referrerpolicy"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 192).
-spec rel(binary()) -> sprocket@internal@context:attribute().
rel(Value) ->
attribute(<<"rel"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 196).
-spec selected() -> sprocket@internal@context:attribute().
selected() ->
attribute(<<"selected"/utf8>>, <<"true"/utf8>>).
-file("src/sprocket/html/attributes.gleam", 200).
-spec src(binary()) -> sprocket@internal@context:attribute().
src(Value) ->
attribute(<<"src"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 204).
-spec style(binary()) -> sprocket@internal@context:attribute().
style(Value) ->
attribute(<<"style"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 208).
-spec tabindex(binary()) -> sprocket@internal@context:attribute().
tabindex(Value) ->
attribute(<<"tabindex"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 212).
-spec target(binary()) -> sprocket@internal@context:attribute().
target(Value) ->
attribute(<<"target"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 216).
-spec title(binary()) -> sprocket@internal@context:attribute().
title(Value) ->
attribute(<<"title"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 220).
-spec value(binary()) -> sprocket@internal@context:attribute().
value(Value) ->
attribute(<<"value"/utf8>>, Value).
-file("src/sprocket/html/attributes.gleam", 224).
-spec width(binary()) -> sprocket@internal@context:attribute().
width(Value) ->
attribute(<<"width"/utf8>>, Value).