Current section

Files

Jump to
sprocket src docs@utils@common.erl
Raw

src/docs@utils@common.erl

-module(docs@utils@common).
-compile([no_auto_import, nowarn_unused_vars]).
-export([maybe/2, example/1]).
-spec maybe(boolean(), LJU) -> gleam@option:option(LJU).
maybe(Condition, Element) ->
case Condition of
true ->
{some, Element};
false ->
none
end.
-spec example(list(sprocket@element:element())) -> sprocket@element:element().
example(Children) ->
sprocket@html:'div'(
[sprocket@html@attributes:class(
<<"not-prose graph-paper bg-white dark:bg-black my-4 p-6 border border-gray-200 dark:border-gray-700 rounded-md overflow-x-auto"/utf8>>
)],
Children
).