----------------------------------- Deliverance README ----------------------------------- See: http://www.openplans.org/projects/deliverance for more information Contents: * What is Deliverance? * Quick Start to build deliverance * Deliverance Proxy * WSGI Middleware * Command Line Transformations * Simple Tests * WSGI Tests * Quick Example ---------------------------------- What is Deliverance? ---------------------------------- Deliverance is a non-invasive mechanism for combining HTML content produced by other systems and normal web pages that typify a desired look and feel (themes) using a set of rules. This approach allows the "branding" aspects of a design to remain separate from content production, allows designers to avoid using and mixing in particular template syntaxes and allows reuse of existing static designs. ----------------------------------- Quick Start to build Deliverance ----------------------------------- If you have recent versions of `lxml `_ installed, along with its underlying library `libxml2 `_, you should pretty much be okay. If you are getting segfaults or warnings, you might need newer software. If so, one way to get Deliverance installed is to checkout the buildout and follow the instructions found there:: $ svn co http://codespeak.net/svn/z3/deliverance/buildout/trunk Otherwise, to install Deliverance manually, first get workingenv.py from http://cheeseshop.python.org/pypi/workingenv.py. Create a working environment for Deliverance and its dependencies:: $ workingenv.py deliverance_env $ source deliverance_env/bin/activate Then install recent versions of libxml2, libxslt and lxml. You are likely to encounter segfaults and other failures if recent versions are not used. Checkout and setup Deliverance, then make sure your installation is complete by running the tests:: $ svn co http://codespeak.net/svn/z3/deliverance/trunk/ deliverance $ cd deliverance $ python setup.py develop $ nosetests You can also run the tests like this:: $ deliverance_env/bin/deliverance-tests $ deliverance_env/bin/deliverance-speed ---------------------------------------------- Deliverance Proxy ---------------------------------------------- The deliverance proxy is a standalone application which serves a themed version of some web location using a theme and a set of rules. :: $ deliverance-proxy --serve=localhost:5001 --proxy=localhost:8080 --theme=http://www.example.org --rule=file:///some/path/somerulesfile.xml This example provides a themed version of a local webserver at port 8080 served on port 5001. The theme page is http://www.example.org and the rules are specified in somerulesfile.xml. For more options, run:: $ deliverance-proxy --help ------------------------------------------------ WSGI Middleware ------------------------------------------------ Deliverance can also be used directly in a WSGI stack using the python class in deliverance.wsgifilter.DeliveranceMiddleware. See deliverance/wsgifilter.py and deliverance/test_wsgi.py for examples. ------------------------------------------------- Command Line Transformations ------------------------------------------------- The command line tool used to execute Deliverance is called deliverance-handtransform. For instructions, run:: $ deliverance-handtransform --help The theme, rules and other parameters are specified using command line options -t, -r, etc. The result of the transform is output to standard out. To avoid lengthy command lines, the tool can accept a "blend" file, using the -f flag, which describes the theme and rules to apply. eg:: $ deliverance-handtransform -f ./blendfile.xml http://www.example.org The second argument refers to the content; blendfile.xml contains something like:: ------------------------------------------------ Simple Tests ------------------------------------------------ There are a number of tests in the test-data directory that follow the form:: ... rules as described at http://www.openplans.org/projects/deliverance/specification ... theme html ... content html ... expected output of applying rules to theme and content ... ---------------------------------------------- WSGI Tests ---------------------------------------------- test_wsgi.py contains tests which take the theme and content from the web and local pages found under test-data. ---------------------------------------------- Quick Example ---------------------------------------------- Deliverance combines a content web page with a theme web page, containing no special markup, according to a set of rules. Example: This is an unstyled page produced by myBoringTodoList.com/deliverance_user/: this page is the content page:: my boring todo page

Things To Do

  • Feed the cat
  • Wash the dishes
Here is another web page that typifies how we'd like to see the todo list at excitingHomePage.com/deliverance_user/. this page is the theme:: my exciting home page

Deliverance User's Exciting Page

I wish my todo list looked this cool
Here are some deliverance rules that put the todo list into the exciting home page and take away the wish. This tells deliverance to replace the "wishes" div in the exciting home page with the "todo" div in the content page:: Here is the output:: my exciting home page

Deliverance User's Exciting Page

Things To Do

  • Feed the cat
  • Wash the dishes
see http://www.openplans.org/projects/deliverance for more information. There are many other examples in deliverance/test-data