HTM for Python
Project description
htm.py
A Python version of developit/htm - JSX-like syntax in plain JavaScript Python.
Documentation
The main documentation of this module is located at https://jviide.github.io/htm.py/.
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
To install locally:
$ pip install -e .
If you want to run tests and build the Sphinx docs and their examples...that runs into a problem with hyperpython's transitive dependencies. Thus:
$ pip install toolz
$ pip install sidekick
$ pip install -e .[docs]
Running Tests
$ python3 -m unittest discover -s tests
Building Docs
Documentation is available in the docs
directory.
First install the dependencies then build the docs:
$ pip install -e .[docs]
$ cd docs
$ sphinx-build -b html . _build
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.1.1.tar.gz
(4.0 kB
view details)
Built Distribution
htm-0.1.1-py3-none-any.whl
(4.9 kB
view details)
File details
Details for the file htm-0.1.1.tar.gz
.
File metadata
- Download URL: htm-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.4.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16c4022baf8c2d41efa20b707d9559190456469c2d5545440559e4599cd95631 |
|
MD5 | bbdfb9d16bb879e7a109914958739ba6 |
|
BLAKE2b-256 | e79193b5027557bfee2879c37c8f4f3984f701040900c4d3580a7d11ea2c342c |
File details
Details for the file htm-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: htm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.4.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7917b83997828e09f0808e3a70d4e873dc9a491552effff63fae91295aa4e14b |
|
MD5 | 06a9939ef58b1a9c4140033a6ab3bba5 |
|
BLAKE2b-256 | 6fd11c8efe8ade35f95fa30246f4eea254527166aca930fdc68ea78f05604cb6 |