[erlang-questions] How do I reformat and output HTML strings as iolists in a convenient way?

Tim Fletcher mail@REDACTED
Wed Nov 23 19:31:43 CET 2011


> This is of course simple enough but does not cover all
> bases nor does it feel right.

It's a good initial 80% solution, but if you're debugging any textual
content you'll nearly always want auto-escaping as a feature. And if
you're doing templating you'll want attribute rendering.

> Now which library should I use if I want a lean, clean syntax in my module.
> Or, put in another way: "Maximal html expressability with minimal erlang
> verbosity."

How about this: https://github.com/tim/erlang-html-render

I've written similar code to this many times before in different
languages. Erlang is a great fit: iolists and pattern matching keep
the implementation simple, and tuples/atoms are perfect for modeling
this kind of data (the same approach in a language that only has
classes/objects is not so pretty).

Cheers,
Tim



More information about the erlang-questions mailing list