Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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!



```