I took a harder look at mochiweb after I sent my first mail thinking that I might have forgotten something and sure enough all the building blocks were there.<div><br></div><div>I guess that I am still ending up on wrong side of this. Implementing yet another module with the transformations I want. Sooner or later I will throw it away because it has become to bloated and I want something leaner. .. *repeat*  Sounds familiar.</div>
<div><br></div><div>Another problem is that I don't really want to have lots of dependencies for an escript, but that is a whole other BoW.</div><div><br></div><div>// Björn-Egil</div><div><br><br><div class="gmail_quote">
2011/11/23 Bob Ippolito <span dir="ltr"><<a href="mailto:bob@redivi.com">bob@redivi.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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><span class="HOEnZb"><font color="#888888">
<br>-bob</font></span><div class="HOEnZb"><div class="h5"><br><br>On Wednesday, November 23, 2011, Daniel Dormont <<a href="mailto:dan@greywallsoftware.com" target="_blank">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" target="_blank">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" target="_blank">erlang-questions@erlang.org</a><br>

>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>>><br>>><br>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>
</div></div></blockquote></div><br></div>