term2html
generate html from an erlang term (ehtml for those familiar with yaws):
Installation
Add term2html to the dependencies in your rebar.config:
{deps, [{term2html, "1.0.1"}]}.then fetch and compile the dependencies of your project:
rebar3 compile --deps_onlyExample
The following term:
Ehtml = {'div', [{class, toto}],
[{p, [], <<"hëllo world"/utf8>>},
{img, [{src, <<"https://eptwalabha.com/taco.png">>},
{alt, <<"a taco">>}]},
{br},
<<"cool eh?">>]}.
term2html:expand(Ehtml).will produce the following html:
<div class="toto"><p>hëllo world</p><img src="https://eptwalabha.com/taco.png" alt="a taco"><br>cool eh?</div>