Ophelia

Build a web site from TAL templates with zero code repetition
Download

Ophelia Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Thomas Lotze
  • Publisher web site:
  • http://www.thomas-lotze.de/en/software/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 38 KB

Ophelia Tags


Ophelia Description

Build a web site from TAL templates with zero code repetition Ophelia is a Python package that assembles XHTML pages from templates. It is used on a web server to generate each page at the moment it is requested. Ophelia creates XHTML pages from templates written in TAL, the Zope Template Attribute Language. It is designed to reduce code repetition to zero.The Ophelia package contains both a WSGI application running Ophelia as well as a request handler for mod_python, which is the Python module for the Apache2 web server.Static contentConsider Ophelia as SSI on drugs. It's not fundamentally different, just a lot friendlier and more capable.Use Ophelia for sites where you basically write your HTML yourself, except that you need write the recurring stuff only once. Reducing repetition to zero comes at a price: your site must follow a pattern for Ophelia to combine your templates the right way.Consider your site's layout to be hierarchical: there's a common look to all your pages, sections have certain characteristics, and each page has unique content. It's crucial to Ophelia that this hierarchy reflect in the file system organization of your documents; how templates combine is deduced from their places in the hierarchy of directories.Dynamic contentOphelia makes the Python language available for including dynamic content. Each template file may include a Python script. Python scripts and templates contributing to a page share a common set of variables to modify and use.Ophelia's content model is very simple and works best if each content object you publish is its own view: the page it is represented on. If you get content from external resources anyway (e.g. a database or a version control repository), it's still OK to use Ophelia even with multiple views per content object as long as an object's views don't depend on the object's type or even the object itself.Trying to use Ophelia on a more complex site will lead to an ugly entanglement of logic and presentation. Don't use Ophelia for sites that are actually web interfaces to applications, content management systems and the like. Here are some key features of "Ophelia": Ophelia avoids repetitive code: · Text and HTML structures common to all pages in a directory are stored in a shared common template. What templates a web page consists of and in which way they are combined follows directly from the URL. Thus, it is not even necessary to write for each page which templates it needs to use. Ophelia is dynamic: · Templates are written in TAL, the Template Attribute Language of Zope. TAL is XHTML with the added possibility to acquire the content of DOM elements and attributes from context variables. The context is modified by Python scripts. A template shares a file with its corresponding script to make for easy handling, but there's still a clean separation of Python code from XHTML content. Ophelia works on files: · All templates and scripts reside in the server's file system. Therefore, one can edit and version-control the contents of one's pages easier than using a relational or object database. On the other hand, one would certainly not want to program complex applications in this manner; Ophelia can't be recommended for anything more than ?SSI on drugs?.


Ophelia Related Software