Skip to main content

Deliverance rewrites HTML to add theming

Project description

Deliverance rewrites HTML pages to theme the pages – adding things like navigation, stylesheets, and applying a common look-and-feel to content from a variety of sources.

Unlike typical templating systems, Deliverance works only on HTML; there’s no variables to substitute or Python structures involved. It takes a simple set of rules and applies these to the HTML, so you can style the output of pages regardless of where the page comes from.

The theme itself is an HTML page with zero code in it. It is simply an example of what a page should look like; this makes it accessible to designers or any kind of tool, and may itself even be dynamically generated. For instance, you might use a blog page as a theme, and wrap that theme around a wiki to give the two a common look and feel.

The rules are written in an XML format, that looks something like:

<rules xmlns:xi=""
       xmlns="" >
  <xi:include href="standardrules.xml" />
  <copy theme="//div[@id='container']"
        content="//*[@id='portal-columns']" />

This example, in addition to doing the ‘standard’ things (which includes merging the <head> of both pages) also copies the tag <div id="portal-columns"> into the theme page’s <div id="container">.

Deliverance is implemented as both a rendering object and WSGI middleware. Included in the package is a script that uses the WSGI middleware as an HTTP proxy.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Deliverance, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size Deliverance-0.1-py2.4.egg (201.9 kB) File type Egg Python version 2.4 Upload date Hashes View
Filename, size Deliverance-0.1-py2.5.egg (200.0 kB) File type Egg Python version 2.5 Upload date Hashes View
Filename, size Deliverance-0.1.tar.gz (94.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page