On Sat, 2006-01-21 at 20:13 +0100, Dirk Meyer wrote:
> Cliff Wells wrote:
> > On Sat, 2006-01-21 at 18:42 +0100, Dirk Meyer wrote:
> >> "Daniel C. Casimiro" wrote:
> >> > Next, a "view" is defined in a file "music_view.pyxml."  This would be
> >> > the tricky implementation part...
> >> >   
> >> > <canvas style="video menu">
> >> >   <image name="background" width="100%" height="100%"/>     
> >> >   <container x="overscan_x1" y="overscan_y1" width="complete width 
> >> >  overscan_x1 - overscan_x2" height="...">
> >> >  <% for item in music_library: %>        // Python code...
> >> >  <text> <% item.name %> </text>  
> >> >  ...
> >> 
> >> By playing with a webserver (see kaa.cherrypy) I found Kid
> >> (http://kid.lesscode.org/). Maybe we can use that.
> >> 
> >
> > I'd recommend taking a look *inside* kid before you do that.  It's not
> > pretty. User defined variables clash with class attributes, so you can't
> > use certain variables in your templates (the docs mention 3 or 4 of
> > them, but there's actually around twice that many).
> 
> So it is 6-8. Depending of the name, it does not seems to be a
> problem. 

That's not the point.  The software is poorly thought out and this is a
merely a single symptom.  TurboGears uses Kid as its default template
system and while most people like it on the surface, about half the
traffic on the list has to do with its shortcomings and frailties.
"Kid templates are a pain to debug" was an especially long thread.

> > Also, fwiw, XML sucks.  
> 
> I know.
> 
> > Have you considered using one of the Python templating/XHTML
> > generation libs like Nevow's Stan or XIST?  Much better.  Terse,
> > clean syntax, less typing, more power.
> 
> Why is XHTML better than XML? XHTML has the problem that it is based
> on a specfic DTD (HTML) where XML is free.

You miss the point.  It is Python-based markup vs XML-based markup that
I'm arguing for.  What particular XML DTD is chosen is irrelevant.  I
use Stan to generate XHTML and wxPython XRC among other things. 
Creating a new DTD is remarkably easy.

> The reason for XML (and maybe Kid) is that theme designers don't know
> Python, they don't want to know. But many can 'code' HTML pages, know
> php and stuff like that. I would prefer a Python based skin code, but
> we would never find any skin designers using that. So XML is our onlt
> choice because people know it (and they don't know it sucks)

Show me the designer who can't see the correlation between:

html [
   head [ 
       title [ 'foo' ]
   ],

   body [
      div [ 'bar' ]
   ]
] 

and 

<html>
    <head>
        <title>foo</title>
    </head>
    <body>
         bar
    </body>
</html>


and I'll show you a designer who isn't doing skins for Freevo anyway.  

Also, show me the designer who understands:

<table>
    <tr py:for="row in somelist">
        <td py:for="image in row" align="center">
        </td>
    </tr>
</table>

and I'll show you a designer who could have grasped Stan or XIST far
easier.

It's a fallacy that XML based templates are easier to grasp for
*anybody*, let alone designers.  Designers don't understand *programming
logic*.  Syntax has nothing to do with it.  It has nothing to do with
whether the tags are enclosed in <> or {}.  If the markup requires logic
you are out of their realm, so trying to appeal to them by using
convoluted markup mashed with code is a waste.

Regards,
Cliff




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to