Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install chameleon.html

How to install chameleon.html

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install chameleon.html
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0b4 Available View build log
Windows (64-bit)
1.0b4 Available View build log
Mac OS X (10.5+)
1.0b4 Available View build log
Linux (32-bit)
1.0b4 Available View build log
Linux (64-bit)
1.0b4 Available View build log
Lastest release
version 1.0b4 on Jan 5th, 2011

This package implements a template compiler for dynamic HTML documents. In particular, it supports the XSS rule language which is used to associate elements with dynamic content.

XSS rule language

The XSS rule language uses a CSS-compliant syntax to let you match HTML elements using CSS selectors and set up dynamic content definitions.

To associate a template with a rule file, use the <link> tag:

<link rel="xss" type="text/xss" src="rules.xss" />

XSS files contain rules like the following:

System Message: WARNING/2 (<string>, line 21)

Literal block expected; none found.

html > head > title { name: document-heading; structure: true; attributes: document-attributes; mode: content; }

This rule will associate the <title> tag with the dynamic content identifier "document-heading", escape the inserted content and apply the dynamic attributes bound to the "document-attributes" identifier.

See the file template.txt within the package for documentation on how to render templates and provide dynamic content and attributes.


Brief explanation of the properties in the XSS format:

@name        dynamic content slot name
@structure   if set to true, inserts content without escaping
@attributes  inserts dynamic attributes into tag
@mode        one of ('content', 'replace', 'append', 'prepend')

Resource rebase functionality

If a resource location adapter is available (see chameleon.html.interfaces.IResourceLocation), references resources (e.g. images, stylesheets, javascripts) will be "rebased" to the URL returned by the component.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.