[Zpt] Bootstrapping ZPT documentation with ZPT (or: Eating your own dogfood)

Guido van Rossum guido@digicool.com
Fri, 02 Mar 2001 11:18:26 -0500


> What say ye all? Should the ZPT specs and general documentation be composed
> using ZPT rather than ST?

Not clear what the win is.  It sure makes authoring a pain for those
of us who have to edit raw HTML!

> BTW,
> 
> I can see creating a the ZPT FrontPage/HomePage as a template that includes
> the body of the other templates (source).  HiperDOM had a special behavior
> defined where a template could include another template. You could do stuff
> like:
> 
> 
> <body>
>   <span hdom:include="Summary.html" />
>   <span hdom:include="RoadMap.html" />
> </body>
> 
> Where Summary.html and Roadmap.html were HiperDOM templates.  Now in ZPT,
> tal:text won't work that way, right?  That is, is Summary.html and
> Roadmap.html had all of the proper HTML/XML headers, they would get included
> too (which isn't what we want in the above example). The only solution that
> comes to mind (right now) is to declare the relevant material in
> Summary.html and Roadmap.html as simple macros and do the following:
> 
> <body>
>   <span metal:use-macro="Summary.html" />
>   <span metal:use-macro="RoadMap.html" />
> </body>
> 
> Now, this is legal (and should work!),

Except that it will probably have to look more like this:

    <span metal:use-macro="here/Summary.html/macros/Summary.html" />.

> but may break the concept of macros
> as units that describe presentation rather than content.

I wouldn't want to place too much emphasis on what macros should or
shouldn't be used for.  They're macros, and they should be used for
whatever they can be used for.

> Maybe, what you
> probably want to do is something like this:
> 
> <body>
>   <span tal:replace="here/Summary.html/id=body" />
>   <span tal:replace="here/RoadMap.html/id=body" />
> </body>
> 
> or
> 
> <body>
>   <span tal:replace="structure extract_element: Summary.html id=body" />
>   <span tal:replace="structure extract_element : RoadMap.html id=body" />
> </body>
> 
> I dunno...

And what would the advantage of that be?

--Guido van Rossum (home page: http://www.python.org/~guido/)