HTM for Python
Project description
htm.py
A Python version of developit/htm - JSX-like syntax in plain JavaScript Python.
Installation
$ pip3 install htm
Usage
from htm import htm
@htm()
def html(tag, props, children):
return tag, props, children
a = 1
b = {"bar": 100}
c = "span"
d = "world"
html("""
<div foo={a+2} ...{b}>
<{c}>Hello, {d}!<//>
</div>
""")
# ('div', {'foo': 3, 'bar': 100}, [('span', {}, ['Hello,', 'world', '!'])])
Development
Running Tests
$ python3 -m unittest discover -s tests
License
This library is licensed under the MIT license. See ./LICENSE.
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
htm-0.0.6.tar.gz
(3.0 kB
view hashes)
Built Distribution
htm-0.0.6-py3-none-any.whl
(3.9 kB
view hashes)