Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 4 March 2010 22:22, Shane Hathaway wrote: > From a template developer's POV, it's useful to apply the same XML > declarations throughout a site using metal. The current syntax is > non-obvious and perhaps problematic, but workable. Some other syntax might > be better, but let's not break the current syntax in the 1.1 branch. I have now implemented support for the following syntax: ... By passing a reference to the actual template instance, it will be used in its entirety, including any XML declarations. Please give the current trunk a spin if you have time, to ensure quality before a release. \malthe ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Shane, Sorry about sending from the wrong email address - thanks for grabbing the relevant bit and putting it back in the thread. On 3/4/10 9:47 PM, Shane Hathaway wrote: > Kevin Kalupson wrote: >> The importance to me is that there isn't a regression to the duplicate >> xml headers when templates render. I like to validate my templates as I >> go and not have to hack them to then test my rendered template. > > Good point. If you're statically validating all templates, then putting > the doctype in every template is a good thing. I think that this is the way to go with zpt and is the often forgotten beauty of zpt. Because you can do this is what makes it better than a lot of other templating languages out there. However, if you're not > statically validating, then putting the doctype in every template is > hazardous, because it's easy to forget, and if you forget, the browser > quietly slips into quirks mode, causing insidious little CSS bugs. > > The moral: I guess static template validation would have saved me those > hours I spent debugging CSS this week, and maybe putting the doctype in > the main template has more cons than pros. > > Shane > -Kevin ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Kevin Kalupson wrote: > The importance to me is that there isn't a regression to the duplicate > xml headers when templates render. I like to validate my templates as I > go and not have to hack them to then test my rendered template. Good point. If you're statically validating all templates, then putting the doctype in every template is a good thing. However, if you're not statically validating, then putting the doctype in every template is hazardous, because it's easy to forget, and if you forget, the browser quietly slips into quirks mode, causing insidious little CSS bugs. The moral: I guess static template validation would have saved me those hours I spent debugging CSS this week, and maybe putting the doctype in the main template has more cons than pros. Shane ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Kevin J. Kalupson wrote: > I just tested in zope2 through the zmi. I seem to recall that this syntax works in Plone. I don't care whether it works in plain Zope 2. Is this really important to you? While it's a special case, I think it's a case of practicality beats purity. I use it a lot. Shane ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 3/4/10 2:50 PM, Malthe Borch wrote: > On 4 March 2010 22:45, Kevin J. Kalupson wrote: >> In that case, there should be macro explicitly containing the doctype >> and other wanted headers. > > Yes, but that's unfortunately impossible. > not impossible: standard_template.pt - http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";> The Title Hey - this is a test. test.pt --- localhost:8080/test.pt - rendered source http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";> Hey - this is a test. > I don't think it's a syntax issue, I think it's a behavioral issue. I >> think the 1.1 branch exhibits broken behavior. > > But keep in mind that we're mimicking ``zope.pagetemplate``. Most > people expect high corcordance. > > I just don't know about this. There's a work-around for you though: if > you don't define the macro as the root node, then you won't get the > doctype. > > \malthe -Kevin ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
I just tested in zope2 through the zmi. standard_template.pt http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";> The Title Hey - this is a test. test.pt --- http://localhost:8080/test.pt - source rendered --- Hey - this is a test. -Kevin On 3/4/10 2:50 PM, Shane Hathaway wrote: > Kevin J. Kalupson wrote: >> >> On 3/4/10 2:22 PM, Shane Hathaway wrote: >> The current syntax is >>> non-obvious and perhaps problematic, but workable. Some other syntax >>> might be better, but let's not break the current syntax in the 1.1 >>> branch. >>> >> I don't think it's a syntax issue, I think it's a behavioral issue. I >> think the 1.1 branch exhibits broken behavior. > > I'm pretty sure it was in 1.0 as well. It's a standard ZPT idiom. > > Shane ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Am 04.03.2010, 17:38 Uhr, schrieb Jasper Op de Coul : > I don't have commit rights to the repoze repository but I attached a > patch. Go on, sign up. You know you want to: http://repoze.org/contributing.html But I think the contribution agreement is a bit lightweight and should be beerware at least! ;-) BTW. Where do website bugs go? Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Kevin J. Kalupson wrote: > > On 3/4/10 2:22 PM, Shane Hathaway wrote: > The current syntax is >> non-obvious and perhaps problematic, but workable. Some other syntax >> might be better, but let's not break the current syntax in the 1.1 branch. >> > I don't think it's a syntax issue, I think it's a behavioral issue. I > think the 1.1 branch exhibits broken behavior. I'm pretty sure it was in 1.0 as well. It's a standard ZPT idiom. Shane ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 4 March 2010 22:45, Kevin J. Kalupson wrote: > In that case, there should be macro explicitly containing the doctype > and other wanted headers. Yes, but that's unfortunately impossible. > I don't think it's a syntax issue, I think it's a behavioral issue. I > think the 1.1 branch exhibits broken behavior. But keep in mind that we're mimicking ``zope.pagetemplate``. Most people expect high corcordance. I just don't know about this. There's a work-around for you though: if you don't define the macro as the root node, then you won't get the doctype. \malthe ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 3/4/10 2:22 PM, Shane Hathaway wrote: > Malthe Borch wrote: >> On 4 March 2010 22:02, Kevin Kalupson wrote: >>> I wouldn't expect the the xml headers in a macro template to be applied to >>> the >>> page template being rendered. It makes no sense to me that an element not >>> contained within a macro definition would be applied to the page calling the >>> macro under any situation. >> >> I sort of agree, except how else would we provide this functionality? >> Or is it actually the case that it doesn't make sense for a macro to >> control these headers –– I suspect it is. > > From a template developer's POV, it's useful to apply the same XML > declarations throughout a site using metal. In that case, there should be macro explicitly containing the doctype and other wanted headers. The current syntax is > non-obvious and perhaps problematic, but workable. Some other syntax > might be better, but let's not break the current syntax in the 1.1 branch. > I don't think it's a syntax issue, I think it's a behavioral issue. I think the 1.1 branch exhibits broken behavior. > Shane > > ___ > Repoze-dev mailing list > Repoze-dev@lists.repoze.org > http://lists.repoze.org/listinfo/repoze-dev -Kevin ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 3/4/10 2:08 PM, Malthe Borch wrote: > On 4 March 2010 22:02, Kevin Kalupson wrote: >> I wouldn't expect the the xml headers in a macro template to be applied to >> the >> page template being rendered. It makes no sense to me that an element not >> contained within a macro definition would be applied to the page calling the >> macro under any situation. > > I sort of agree, except how else would we provide this functionality? > Or is it actually the case that it doesn't make sense for a macro to > control these headers –– I suspect it is. > I think it's the case that it doesn't make sense for the macro to control these headers. I have never had the expectation that a tag or header outside of a macro definition would appear in the final rendered page. > Plone's answer to this is to have its wrapper template manually write > out the XML declaration or maybe just the DOCTYPE. That seems kind of > crude as well. > > \malthe > ___ > Repoze-dev mailing list > Repoze-dev@lists.repoze.org > http://lists.repoze.org/listinfo/repoze-dev -Kevin ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
Malthe Borch wrote: > On 4 March 2010 22:02, Kevin Kalupson wrote: >> I wouldn't expect the the xml headers in a macro template to be applied to >> the >> page template being rendered. It makes no sense to me that an element not >> contained within a macro definition would be applied to the page calling the >> macro under any situation. > > I sort of agree, except how else would we provide this functionality? > Or is it actually the case that it doesn't make sense for a macro to > control these headers –– I suspect it is. From a template developer's POV, it's useful to apply the same XML declarations throughout a site using metal. The current syntax is non-obvious and perhaps problematic, but workable. Some other syntax might be better, but let's not break the current syntax in the 1.1 branch. Shane ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 4 March 2010 22:02, Kevin Kalupson wrote: > I wouldn't expect the the xml headers in a macro template to be applied to the > page template being rendered. It makes no sense to me that an element not > contained within a macro definition would be applied to the page calling the > macro under any situation. I sort of agree, except how else would we provide this functionality? Or is it actually the case that it doesn't make sense for a macro to control these headers –– I suspect it is. Plone's answer to this is to have its wrapper template manually write out the XML declaration or maybe just the DOCTYPE. That seems kind of crude as well. \malthe ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] [issue139] Chameleon - can't create xml and doctype declarations from macro
On 4 March 2010 19:38, Jasper Op de Coul wrote: > I don't have commit rights to the repoze repository but I attached a patch. > The last testcase is failing, although this worked in previous versions of > Chameleon. I've committed this. These seem like fairly critical regressions; I'll try to look at them asap. \malthe ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev