Hi Sergey,

Am 21.10.2006 um 22:11 schrieb Sergey Lipnevich:
> Genshi is very powerful if it can render complete Wiki text without
> pre-rendering in the code. I tried something similar (color-coding
> overlapping portions of text in my own app) and decided not to do it
> in template because frankly I wasn't sure how to begin. So you rule
> guys :-)! But why not ask a macro if it needs to add a stylesheet to
> the page?

Because we don't (currently) know which macros/processors are going  
to be used without actually performing the rendering. Of course, this  
situation may change, and at some point we may know enough about wiki  
content to be able to do this without javascript.

> Maybe the all-or-nothing approach (render in code vs render
> in template) is not the best in this case? In more complex cases, a
> macro or a processor may want to change MIME format or introduce an
> http-equiv="Refresh" meta keyword (in Bitten). Or this not part of the
> design for macros or processors?

No, macros shouldn't change the MIME type of the output, as they have  
no control over where they get embedded. For meta-refresh, I don't  
think it's a particularly good technique, the effect is more easily  
and elegantly implemented using XHR these days (which the now  
integrated jQuery makes dead easy).

I don't think there's *anything* a macro would want to add to the  
page it's embedded in, apart from what we're talking about here:  
requesting additional external stylesheet and script files.

> Consider also that JavaScript is not good when it comes to unit
> testing Web page generation. It's far easier to just test if there's a
> reference to a stylesheet than to test that there's a javascript that
> hopefully will insert this reference later.

That's not really "unit testing" now, is it ;-)

It's way easier to test this stuff at a lower level (using *actual*  
unit tests), and then perform functional tests in the browser, either  
manually, or using something like Selenium.

Cheers,
Chris
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/trac-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to