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:
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.
Syntax
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', '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.
Metadata
Release files for chameleon.html 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chameleon.html-0.9.3.tar.gz | 12.0 kB | Without provenance | Details |
Release files / chameleon.html-0.9.3.tar.gz
| Download URL | chameleon.html-0.9.3.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f339fd9007969472187f7c545127c5b7b9ecafa5124ee046262e3f5e8484a41
|
|
BLAKE2b-256 checksum How to use checksums |
5323c436c31932651d7dd63fa2bf0dcc96cbbb6f6fb0c1c8e2295c7f90f270ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for chameleon.html 0.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.