[erlang-questions] [ANN] Brim - HTML templating library

Per Melin per.melin@REDACTED
Thu Mar 15 15:59:31 CET 2012


On Mar 15, 2012, at 13:17 , Michael Turner wrote:

> Not for lack of trying: we hapless Windows users got Microsoft Bob,
> then "Clippy," then that annoying dolphin swimming around on our
> desktops.

Of all the possible reactions, evoking Clippy was not one I could have foreseen.


> Anyway, I'm just hinting at a possible approach. I'm a little
> concerned, because at this point it looks like you're starting to
> implement a whole little language, with code passed in string
> parameters  (e.g., "tr:not([id^=ker])".

This little language-in-a-string is not something I necessarily want, but it is also not something that I invented; http://www.w3.org/TR/selectors/#selectors

Forcing your users to learn yet another thing is not what I strive for, but I hope CSS selectors are at least well known to anyone who works with HTML. I'd happily do away with selectors for Erlang, but I doubt I could create an API that would be nearly as expressive in a way that takes any less effort to learn.

E.g. "div#foo span.bar:first-child" matches any <span> with class "bar" that is the first child of its parent element and also a descendant of a <div> with id "foo". I don't know yet if this kind of power is overkill for this application.

The state that I'm passing around is a zipper tree representing the HTML. I could of course give you the exported functions of my zipper module and let you navigate that way.




More information about the erlang-questions mailing list