toolbox: breve for xml generation in python

Every once in a while, I head over the cheeseshop and just scroll down. It’s really nice to see so many cool things. Today, I caught Breve, which is evidently inspired by Stan. The guy that wrote it wrote a Turbogears plugin to support stan, and seems very familiar with it, which drove him to frustration, and breve is the product a complete rewrite. I think this is terrific. I’m looking forward to using it.

The author, Cliff Wells, wrote in a blog post called Python template engines – why reinvent PHP? ponders about why templating authors don’t seem to like stan-a-likes. I think there are some usability principles at work here: monotony and consistency. When I write a template, it helps if the output looks fairly similar to the input. So if the output is HTML, I basically want the input to look very similar. When I read the stan docs, it’s not quite clear how to do some of the things that commonly need to be done in templates: conditionally output some class name, or block of HTML. With simple, procedural templates it is clear, which is why php-style templating engines are so successful.

I think the chief audience of breve, and similar efforts, are people that need a templating language for XML. That’s how I plan to use it. I plan on outputing pure XML, and then use XSLT to transform it into whatever format I need.

I wonder what part a templating engine would play in a atom publishing system. Would it even be necessary if the API was designed well? I believe amplee’s API includes a mechanism by which objects know how to render themselves as XML. Since the ATOM syntax is constrained to a standard specification, this is not too much of a pain.

Cliff mentioned in a recent blog post that he was using pylons and breve to develop a new blog. I hope he takes a look at brightcontent before spending a lot of effort.

One Comment

  1. Posted March 2, 2017 at 1:15 pm | Permalink

    I went over this internet site and I think you
    have a lot of wonderful information, saved to my bookmarks

Post a Comment

Required fields are marked *

%d bloggers like this: