From: Tavis R. <ta...@ca...> - 2001-04-25 03:19:00
|
> Did you embrace the regex limitation as a short term > thing for getting the kit going, or this something that > you wanted to preserve for the lifetime of the kit? They're a lifetime thing. It keeps the code understandable. Doing this with a full lexical parser would be a major undertaking. I couldn't imagine doing this with something like mx.TextTools!! We've got all the good bits of velocity plus taglibs, a caching framework, nesting, and a full implementation of PSP into just over a 1,000 lines with this approach so I see no need to abandon it. I don't really see them as a limitation, they just require you to be very explicit about closure so the tags can be easily separated from the surrounding text. > BTW There is a MiscUtils.DictForArgs that can take > strings like "foo=1 bar=2" and turn them into a Python > dictionary. Excellent. I'll have a look at it when I get to that stage. > I thought we earlier agreed $! was bad on the basis of > being arcane. ! has no relation to optionality and it's > "yet another symbol", YAS (tm). We can't avoid all > symbols, but we can keep it tight. Agreed - I just missed that part of the discussion. > [1] If option X can be shorthanded, on what basis should > all others be required in so-called "long" format (which > is not all that long)? "maxlen" is just as fundamental > as "timeout" in my book. What's fundamental, or rather > what's popular, seems strongly related to the template > author and his applications. How are you using maxlen? > [2] What is it that you will be caching in your > templates? Terrel brough this issue up with his BuildKit comments. Most of what I put on a page is static, but still soft-coded. BodyTag attribs, colours, table-widths, doctypes, metatags, css definitions, footers, etc. are not likely to change much from view to view. I'm loath to hard-wire all these things into HTML so I'll soft-code them with the cache option on. > In my applications, my data typically resides in a > database or comes from a stream (such as financial market > info). I can't really afford to "cached foo for 15 > minutes". People want to really see what's in the > database or going on in the market now, not 15 minutes > ago. True, but most of the content on a dynamic page is still static. The data may change but how it's displayed rarely does. In those cases where things do change dynamically you can just leave them as $var or use the TemplateServer.refresh(names) method to programmatically refresh vars. An example would be a discussion board that only changes when someone posts something new. $*discussionBoard can be programmatically refreshed for every new posting. > And finally, I apologize for hammering on your templating > kit so much, but it looks pretty awesome and I generally > like it, so that's why I'm so involved and vocal. > Although I still need to digest others' work including > Ian's. Don't apologize - it's better to have a lively debate than a flawed product :-) Cheers, Tavis |