pyx
is a toy static site generator in Python. It takes advantage of Python's with statement to intuitively express HTML documents in Python:
with open('foo.html', 'w') as dest:
with write_to(dest):
with body():
with ul():
for page_name in ['foo', 'bar']:
with li():
t(page_name)
would translate into:
<body>
<ul>
<li>
foo
</li>
<li>
bar
</li>
</ul>
</body>
- Install
pyx
withpip install git+https://github.com/ykiu/pyx.git
.
An example would be found in sample_project/index.py.