Programming Translating Mako -> Genshi

#1
Volunteers needed! Code is in /branches/genshi.

www.makotemplates.org
http://genshi.edgewall.org/

Here's a template for regular pages in a section:

Code:
<html xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:strip="True">
      
      <py:match path="title" once="True">
          <title>Big Misty</title>
      </py:match>
      
      <py:match path="breadcrumbs" once="True">
          <breadcrumbs><a>This Page</a></breadcrumb>
      </py:match>
      
      <py:match path="content" once="True">
      <content>
          <p>The girth of the Misty is de big Misty</p>
          ...
      </content>
      </py:match>
      
      <xi:include href="base.html" />
</html>
Note: Not every page needs breadcrumbs. For instance, the index page should not have a breadcrumb.

----------

"Base" files in a section (like scms/base.html) need some special attention. They extend the main base template (in /base.html, which extends /raw.html). Here is an example:

Code:
<html xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:strip="True">
            
      <py:match path="title" once="True">
          <title>${select("text()"}} - SCMS</title>
      </py:match>
      
      <py:match path="head" once="True">
          <head>
              ... any css you need here ...
              ${select("*")}
          </head>
      </py:match>
      
      <py:match path="breadcrumbs" once="True">
          <breadcrumbs><a href="/scms/">SCMS</a> ${select("*")}</breadcrumbs>
      </py:match>
      
      <py:match path="content" once="True">
      <nav>
      <navbody section="SCMS">
          <a href="/scms/link1">Link1</a>
          <a href="/scms/link2">Link2</a>
          <a href="/scms/link3">Link3</a>
      </navbody>
      <content />
      </nav>
      </py:match>
      
      <xi:include href="base.html" />
</html>
(Note: I have a Genshi transformation filter that will remove the <a> on the current link and replace it with <strong>, and everything in the navbody will be listified. Don't worry about any of that! The whole purpose of switching template systems is to make our lives easier.)

(Note2: Not every base adds "- Section" to the output. If it doesn't currently, don't add the code)