{{{ #!rst **This page is now largely irrelevant -- the website no longer uses Pyramid to build.** Pyramid User's Guide #################### Overview ======== Pyramid deals with fragments (of html) that can contain any number of slots, each identified by a name. Data are mapped into each slot in the fragment through a dictionary-like interface. A fragment is created by combining an html template and a data mapping. Created fragments may also have slots in them, allowing for further substitutions, and so on. Fragments can map more complex structures than simple names. A slot can be filled by a list (using parameterised template html for each item in the list), for example. Even more flexibly, specific html tags can cause custom renderers (that can transform the html) to be invoked. Typical uses of of pyramid only use simple lists and mappings, but more is there when you need it. The system's power comes from applying the same technique at multiple levels, allowing templating tasks of arbitrary complexity to be implemented without imposing arbitrary restrictions on html structure. The final aspect of the system, that allows sites to be built around a common templated structure, is the ability for data items and templates to be inherited from parent directories. A single html 'skin' can be defined at the root of a directory structure. Each child fragment will, if unable to find the specified template in its own directory, search back towards the root directory looking for the required template. .. contents:: Table of Contents Introduction ============ A simple example template, which perhaps would be used on the news page of a site for a list of news items, should demonstrate the basic concepts. Here is the data structure :: # file = news.yml --- !fragment template: news.html local: heading: The News welcome-message: Welcome to the news news: here is the news and here is the html template:: # file = news.html
1
2
1
2
1
2
Unfortunately, new-style classes have not yet been integrated into Python's standard documention. Fear not, however; many people have worked to provide useful information on creating and using new-style classes:
Name | Coordinator | Description | Info | Expires |
---|---|---|---|---|
|