HTML Templating DSL for Python
Project description
HTML Templating DSL for Python.
==============================
A simple HTML templating library that uses a DSL
mini-language. I tried to design it to be similar in feel
to Teacup/CoffeeKup (https://github.com/goodeggs/teacup). I
also took inspiration from jamescasbon's template.py script
(https://gist.github.com/jamescasbon/1461441).
Also includes the md() function for embedding markdown, and an option
for outputting prettified HTML.
Example usage::
from teacup import *
with html:
with head:
pass
with body:
with p:
md("This is a **test!**")
with p({"class":"test"}, id="testme"):
text("Another test")
a("Click here", href="https://google.com")
print(render())
The python "with" keyword is used to nest HTML tags.
==============================
A simple HTML templating library that uses a DSL
mini-language. I tried to design it to be similar in feel
to Teacup/CoffeeKup (https://github.com/goodeggs/teacup). I
also took inspiration from jamescasbon's template.py script
(https://gist.github.com/jamescasbon/1461441).
Also includes the md() function for embedding markdown, and an option
for outputting prettified HTML.
Example usage::
from teacup import *
with html:
with head:
pass
with body:
with p:
md("This is a **test!**")
with p({"class":"test"}, id="testme"):
text("Another test")
a("Click here", href="https://google.com")
print(render())
The python "with" keyword is used to nest HTML tags.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
teacup-0.3.tar.gz
(4.2 kB
view details)
File details
Details for the file teacup-0.3.tar.gz
.
File metadata
- Download URL: teacup-0.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | add711f41b2b2591de6d944c276d720089adc2f32523be0cc5be52e91d97c846 |
|
MD5 | 66ec4f0f449682b83b238723c0a81ef6 |
|
BLAKE2b-256 | d0d42722413be36d6f4a68749f0734e382776e365d8832d44a99d4ac56e0e149 |