Metadata-Version: 2.1
Name: j2htmx
Version: 0.1.0
Summary: jinja2 template for light-weight htmx page rendering
Home-page: https://github.com/ko10ok/j2htmx
Author: Yuriy Sagitov
Author-email: pro100.ko10ok@gmail.com
License: Apache-2.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Jinja2 <4,>=3.1.3

# Maxwell's demon of test enviroment

## page/page.py
```python
from j2htmx import Component


class Page(Component):
    ...
```

## page/i.html
```html
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
</head>
<body id="{{ component }}">
   {{ param_text }}
</body>
</html>
```

## main.py

```python
from aiohttp import web
from aiohttp.web_request import Request

from page.page import Page

routes = web.RouteTableDef()

app = web.Application()


async def root_page(request: Request) -> web.Response:
    return web.Response(text=await Page().finalize(
        param_text='Hi'
    ), headers={'Content-type': 'text/html; charset=utf-8'})


app.add_routes([
    web.get('/', root_page)
])

if __name__ == "__main__":
    web.run_app(app)
```
