"""index.html""" <?xml version="1.0" encoding="utf-8"?> <!--! You should read the "Geddit" tutorial: http://genshi.edgewall.org/wiki/GenshiTutorial --> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http:// genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude"> <py:match path="head" once="true"> <head py:attrs="select('@*')"> <title>${c.title}<title/> <div py:strip="True">${select('*|text()')}</div> </py:match> <py:match path="body" once="true"> <body py:attrs="select('@*')"> SimpleSite <a name="top" /> <h1>${c.heading or 'No Title'}</h1> ... <div py:strip="True">${select('*|text()')}</div> </body> </py:match> </html>
"""view.html""" <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http:// genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="index.xml" parse="xml" /> <head /> <body>${c.page.content}</body> </html> -- Jerry On Dec 24, 4:19 am, johntable <[email protected]> wrote: > HI, > I am reading the pylonsbook, and I want to use Genshi to implate the > SimpleSite example. But I find it is not as easier as using Mako or > Jinja to implate the layout. > > Who can give me the Genshi examples of index.html and view.html? > > Thanks very much!! > > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| > index.html: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <title>${self.title()}</title> > ${self.head()} > </head> > <body> > ${self.header()} > ${self.tabs()} > ${self.menu()} > ${self.heading()} > ${self.breadcrumbs()} > ${next.body()} > ${self.footer()} > </body> > </html> > <%def name="title()">SimpleSite</%def> > <%def name="head()"></%def> > <%def name="header()"><a name="top"></a></%def> > <%def name="tabs()"></%def> > <%def name="menu()"></%def> > <%def name="heading()"><h1>${c.heading or 'No Title'}</h1></%def> > <%def name="breadcrumbs()"></%def> > <%def name="footer()"><p><a href="#top">Top ^</a></p></%def> > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| > view.html: > <%inherit file="/base/index.html"/> > <%def name="title()">${c.page.title}</%def> > <%def name="heading()"><h1>${c.page.heading or c.page.title}</h1></ > %def> > ${c.page.content} > |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
