Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenhack/python-untemplate
A pure-python alternative to templating libraries.
https://github.com/zenhack/python-untemplate
Last synced: 16 days ago
JSON representation
A pure-python alternative to templating libraries.
- Host: GitHub
- URL: https://github.com/zenhack/python-untemplate
- Owner: zenhack
- License: cc0-1.0
- Created: 2015-03-01T19:04:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-09T05:08:49.000Z (almost 10 years ago)
- Last Synced: 2024-10-22T07:00:34.758Z (2 months ago)
- Language: Python
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
`python-untemplate` is an alternative to xml/html templating libraries.
It provides facilities for quickly and easily constructing documents in
python itself, unlocking access to the full power of the python
programming language in your untemplates.`python-untemplate` works, but is still very new, and probably has a few
rough edges.# Appetizer
Code:
```python
from untemplate.html import *
def base(title, *content):
return Html(
Head(
Title(title),
),
Body(
H1(title),
Div(id="content")(*content),
),
)github = "//github.com/zenhack/python-untemplate"
doc = base("Hello, Untemplate")(
P(
Code("python-untemplate"), ''' is an alternative to xml/html
templating libraries. It provides facilities for quickly and
easily constructing documents in python itself, unlocking access
to the full power of the python programming language in your
untemplates.
'''
),
P(
"Fork us on ", A(href=github)("Github"), "!",
),
)print(doc)
```
Output:
```html
Hello, Untemplate
Hello, Untemplate
python-untemplate
is an alternative to xml/html
templating libraries. It provides facilities for quickly and
easily constructing documents in python itself, unlocking access
to the full power of the python programming language in your
untemplates.
Fork us on Github!
```