When you install genshi, is the appropriate engine installed by
default?  I ask because to use Kid or Cheetah with pylons you have to
install tubrokid or turbocheetah to supply the engine.  Other wise this
looks like just any other engine that can be used with the buffit plugin

Jose

Shannon -jj Behrens wrote:
> On 10/15/06, Pedro Algarvio, aka, s0undt3ch <[EMAIL PROTECTED]> wrote:
>   
>> Hello ppl.
>>
>> I'm specially interested in Genshi since I code some plugins for Trac
>> and sooner or latter I'll have to learn how to use it.
>> Since I've seen some Pylons users already using it, what I ask is, what
>> needs to be done for Pylons to use Genshi instead of Myghty?
>>
>> What get's lost by doin' so?
>>
>> And if possible some examples of Pylons using genshi.
>>     
>
> Hey, Pedro,
>
> * In middleware.py, I have:
>
>      # Load our Pylons configuration defaults
>      config = load_environment()
>      config.init_app(global_conf, app_conf, package='acctmgr')
>
> +    # Setup Genshi
> +    myghty = config.template_engines.pop()
> +    config.add_template_engine('genshi', 'acctmgr.templates', {})
> +    config.template_engines.append(myghty)
>
> * Next, you need an __init__.py in the templates directory.
>
> * Now you can use render_response("templatename").
>
> * Genshi templates live as .html documents in the templates directory.
>
> * Now, you'll probably want to inherit from a site-wide layout.
> Perhaps this file will give you an idea of how I set things up:
>
> =================================================================
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>
> <!--!This is a generic HTML skeleton.
>
> Breaking this into its own template is perhaps overkill, but it's a great way
> to test using multiple layers of layouts.
>
> Sub-templates should call the following before the closing <html> tag:
>
>     <xi:include href="html.html" />
>
> The following methods may be overriden:
>
> html_matches
>   These are a list of your matches to override this content.
>
> html_body_onload
>   This is a simple method for adding things to the body onload.  Don't overuse
>   this.
>
> html_head_inside
>   This is content that belongs in the head.
>
> html_inside
>   This is the content that goes inside the "main slot".
>
> Notice the idiom I'm using.
>
> -->
>
> <html xmlns="http://www.w3.org/1999/xhtml";
>       xmlns:py="http://genshi.edgewall.org/";
>       xmlns:xi="http://www.w3.org/2001/XInclude";>
>
>   $html_matches
>
>   <head>
>     <title></title>
>     $html_head_inside
>   </head>
>
>   <body onload="$html_body_onload">
>     $html_inside
>   </body>
>
> </html>
> =================================================================
>
> You can use this same idiom to have multiple layers (common
> look-and-feel, site look-and-feel, section look-and-feel, page).  I
> use Genshi's "match" mechanism to override things like the title.
>
> Naturally, I'm just following the recipes:
> http://genshi.edgewall.org/wiki/GenshiRecipes
>
> I hope that helps.
>
> Happy Hacking!
> -jj
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to