Fast, robust HTML templating engine
Project description
piglet-templates is a text and HTML templating engine in the genshi/kajiki templates family.
The Piglet template engine offers:
Template inhertitance through <py:extends>/<py:block> (similar to Jinja2)
Compiles templates to fast python byte code.
HTML templating: templates produce well formed HTML. Template variables are autoescaped to protect against XSS attacks.
Reusable template functions.
Good i18n support.
Clear tracebacks from exceptions raised in templates.
Piglet Template Engine Documentation | Repository
Example piglet template:
<py:extends href="layout.html">
<py:block name="content">
<h1>This is the content block.</h1>
<p>
Hello $user.firstnames $user.lastname!
</p>
<p py:for="verse in poem">
<py:for each="line in verse">$line<br/></py:for>
</p>
</py:block>
</py:extends>
There’s a text templating mode too:
Hello $user.firstnames $user.lastname!
{% for verse in poem %}
{% for line in verse %}$line
{% end %}
{% end %}
License
Piglet-templates is licensed under the Apache license version 2.0.
Piglet-templates is developed by Olly Cope and was created for skot.be
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file piglet_templates-1.3.2-py3-none-any.whl
.
File metadata
- Download URL: piglet_templates-1.3.2-py3-none-any.whl
- Upload date:
- Size: 67.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf7ada1ed640d31e8fd03eac0825782f53a4a89789b8f13fa6925182c6814f92 |
|
MD5 | 8106108fcd95bc02d1e832395e0b61aa |
|
BLAKE2b-256 | b7921dc7f7b51a99e7c1214940380e70978b42ac50002c81a5a8412bcdbff3f6 |