xcomponent-0.9.0
توضیحات
An embeded component base template engine - inspired by JSX
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | xcomponent-0.9.0 |
| نام | xcomponent |
| نسخه کتابخانه | 0.9.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Guillaume Gauvrit <guillaume@gauvr.it> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/xcomponent/ |
| مجوز | MIT |
# XComponent
## What Is XComponent
XComponent is a template engine, inspired by JSX, to embed template in Python.
It diverge from all existing Python template engine since all the templates
must be written inside the Python code.
This is a design decision and a matter of preference for the locality of behavior.
> ⚠️ **Under Development**
**Hello world example:**
```python
from xcomponent import Catalog
catalog = Catalog()
@catalog.component()
def HelloWorld(name: str = "world") -> str:
return """<p>Hello {name}</p>"""
HelloWorld(name)
# will render <p>Hello Bob</p>
catalog.render("<HelloWorld name='Bob'/>")
# will also render <p>Hello Bob</p>
```
## How it works
Using XComponent, templates are stored in a catalog of components, and then
they can be rendered to HTML.
All components can be reused in other components in order to build an HTML document
at the end.
Using curly brace let's have a friendly expression language, inspired by Python,
JSX and Rust.
[Getting started ?](https://mardiros.github.io/xcomponent/)
نیازمندی
| مقدار | نام |
|---|---|
| xtr | furo>=2024.5.6; |
| xtr | linkify-it-py<3,>=2.0.3; |
| xtr | myst-parser<5,>=4.0.0; |
| xtr | sphinx<9,>=8.0.0; |
| xtr | sphinx-autodoc2<1,>=0.5.0; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.11 | Python |
نحوه نصب
نصب پکیج whl xcomponent-0.9.0:
pip install xcomponent-0.9.0.whl
نصب پکیج tar.gz xcomponent-0.9.0:
pip install xcomponent-0.9.0.tar.gz