I wouldn't say that mochiweb_html has good support for transforms, but it's easy enough to build that stuff.<br><br>mochiweb isn't a framework, it's just a collection of libraries that we use. mochiweb_html is mostly self-contained although it depends on another module or two full of relevant constants. <br>
<br>-bob<br><br>On Wednesday, November 23, 2011, Daniel Dormont <<a href="mailto:dan@greywallsoftware.com">dan@greywallsoftware.com</a>> wrote:<br>> I've had decent luck with mochiweb_html so far. It doesn't require the<br>
> full mochiweb framework (though it's not totally self contained - some<br>> of the other modules are needed). Check out mochiweb:to_html, which<br>> does require a data structure somewhat different from what you have in<br>
> your render function but might work.<br>><br>> dan<br>><br>> 2011/11/22 Björn-Egil Dahlberg <<a href="mailto:wallentin.dahlberg@gmail.com">wallentin.dahlberg@gmail.com</a>>:<br>>> I am frequently in a position where I render html output from logs or<br>
>> dynamically render erlang data to html in a server.<br>>> Usually I don't use any lib for this but rather do something like,<br>>><br>>> render({Tag, Data}) -><br>>>     T = atom_to_binary(Tag, utf8),<br>
>>     [ <<"<",T/binary,">">>, render(Data),<<"</",T/binary,">">>];<br>>> render(I) when is_integer(I) -> I;<br>>> render(Data) when is_binary(Data) -> quote(Data).<br>
>> render([I|Is]) -> [render(I) | render(Is)];<br>>> render([]) -> [].<br>>> and put an io:put_chars([render(Data)]) somewhere.<br>>> This is of course simple enough but does not cover all bases nor does it<br>
>> feel right. =)<br>>> In other cases I would like an html file where I can embed tags (like ruby<br>>> on rails or yaws) and substitute the tags for my input.<br>>> Mind you, I just want my iolist. I do *not* want a framework which sets up<br>
>> dispatchers, sockets, handlers and what not. I just want an easy way, from<br>>> erlang, to describe html strings or rewrite a template file (or string). In<br>>> the template some javascripts and headers are usually defined while the body<br>
>> or some content div should be substituted. Well, I think you get it.<br>>> Now which library should I use if I want a lean, clean syntax in my module.<br>>> Or, put in another way: "Maximal html expressability with minimal erlang<br>
>> verbosity."<br>>> What should I use?<br>>> // Björn-Egil<br>>> _______________________________________________<br>>> erlang-questions mailing list<br>>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>> <a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>>><br>>><br>> _______________________________________________<br>> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>>