Erlang HTML generation module

Tag: REFERENCE
Edit
This is a little ugly w/r/t to exports and imports on the other side, but it makes for nice server-side React/Hiccup style html generation.
-module(html_gen).
-export([
         a/2,
         td/1, td/2,
         tr/1, tr/2,
         html/1, html/2,
         body/1, body/2,
         table/1, table/2,
         input/1,
         label/2,
         div_/1, div_/2,
         br/1, br/0,
         form/2,
         h2/1, h2/2,
         p/2,
         button/2,
         textarea/2
        ]).

atom_to_binary(Atom) -> list_to_binary(atom_to_list(Atom)).

td(Content) -> tag_gen("td", Content).
tr(Content) -> tag_gen("tr",  Content).
html(Content) -> tag_gen("html", Content).
body(Content) -> tag_gen("body", Content).
table(Content) -> tag_gen("table", Content).
h2(Content) -> tag_gen("h2", Content).
div_(Content) -> tag_gen("div", Content).

html(Attribs, Content) -> tag_gen("html", Attribs, Content).
body(Attribs, Content) -> tag_gen("body", Attribs, Content).
form(Attribs, Content) -> tag_gen("form", Attribs, Content).
label(Attribs, Content) -> tag_gen("label", Attribs, Content).
button(Attribs, Content) -> tag_gen("button", Attribs, Content).

div_(Attribs, Content) -> tag_gen("div", Attribs, Content).
h2(Attribs, Content) -> tag_gen("h2", Attribs, Content).
a(Attribs, Content) -> tag_gen("a", Attribs, Content).
p(Attribs, Content) -> tag_gen("p", Attribs, Content).

table(Attribs, Content) -> tag_gen("table", Attribs, Content).
td(Attribs, Content) -> tag_gen("td", Attribs, Content).
tr(Attribs, Content) -> tag_gen("tr", Attribs, Content).

input(Attribs) -> single_tag_gen("input", Attribs).
textarea(Attribs, Content) -> tag_gen("textarea", Attribs, Content).

br() -> <<"
">>. br(Attribs) -> single_tag_gen("br", Attribs). single_tag_gen(TagName, Attribs) -> [<<"<">>, TagName, <<" ">>, [[ atom_to_binary(Attrib), <<"=\"">>, Value, <<"\" ">> ] || {Attrib, Value} <- Attribs], <<"/>">>]. tag_gen(TagName, Content) -> [<<"<">>, TagName, <<" >">>, Content, <<">, TagName, <<">">>]. tag_gen(TagName, Attribs, Content) -> [<<"<">>, TagName, <<" ">>, [ [ atom_to_binary(Attrib), <<"=\"">>, Value, <<"\" ">> ] || {Attrib, Value} <- Attribs], <<">">>, Content, <<">, TagName, <<">">>].