django-neat-html


Namedjango-neat-html JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-10-14 19:44:41
maintainerNone
docs_urlNone
authorSam Dudley
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # django-neat-html

Integrate `neat-html` as a template backend for Django.

## Examples

- [counter](example/neats/pages/counter.py)

## Installation

Using [pip](https://pip.pypa.io/en/stable/):

```bash
pip install django-neat-html
```

## Configuration

Add the `django_neat_html.NeatHtml` template backend.

```python
# my_project/settings.py

TEMPLATES = [
    ...
    {
        'NAME': 'neat_html',
        'BACKEND': 'django_neat_html.NeatHtml',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {},
    },
]
```

## Usage

Write some components using the `neat-html` package.

```python
# my_project/my_app/neats/components.py

from neat_html import Element, h

def my_page(context) -> Element:
    return h("h1", "My page")
```

Reference them as a template in your Django views.

```python
# my_project/my_app/views.py

from django.template.response import TemplateResponse

def my_view(request):
    return TemplateResponse(request, "my_project.my_app.neats.component.my_page", {})
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-neat-html",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sam Dudley",
    "author_email": "dudley.co.uk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f5/68/a22348c4de1681760d443919e9afd1226a54e26f094161b84c21dc47fa23/django_neat_html-0.1.0.tar.gz",
    "platform": null,
    "description": "# django-neat-html\n\nIntegrate `neat-html` as a template backend for Django.\n\n## Examples\n\n- [counter](example/neats/pages/counter.py)\n\n## Installation\n\nUsing [pip](https://pip.pypa.io/en/stable/):\n\n```bash\npip install django-neat-html\n```\n\n## Configuration\n\nAdd the `django_neat_html.NeatHtml` template backend.\n\n```python\n# my_project/settings.py\n\nTEMPLATES = [\n    ...\n    {\n        'NAME': 'neat_html',\n        'BACKEND': 'django_neat_html.NeatHtml',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {},\n    },\n]\n```\n\n## Usage\n\nWrite some components using the `neat-html` package.\n\n```python\n# my_project/my_app/neats/components.py\n\nfrom neat_html import Element, h\n\ndef my_page(context) -> Element:\n    return h(\"h1\", \"My page\")\n```\n\nReference them as a template in your Django views.\n\n```python\n# my_project/my_app/views.py\n\nfrom django.template.response import TemplateResponse\n\ndef my_view(request):\n    return TemplateResponse(request, \"my_project.my_app.neats.component.my_page\", {})\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4c900de2c39c37ae7600b19fafb0537424d2b94d5423d09c8127933ca6398cb",
                "md5": "09cbd5f5b6cb42a2f28258358c6e4fc3",
                "sha256": "1207bca5916462385a4ed483a5c8356c7d3ddb95b77988d29a88f7948b39c856"
            },
            "downloads": -1,
            "filename": "django_neat_html-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09cbd5f5b6cb42a2f28258358c6e4fc3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 3261,
            "upload_time": "2024-10-14T19:44:40",
            "upload_time_iso_8601": "2024-10-14T19:44:40.002829Z",
            "url": "https://files.pythonhosted.org/packages/f4/c9/00de2c39c37ae7600b19fafb0537424d2b94d5423d09c8127933ca6398cb/django_neat_html-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f568a22348c4de1681760d443919e9afd1226a54e26f094161b84c21dc47fa23",
                "md5": "0790f4f68dae2d90d317ce42dcb4c9f0",
                "sha256": "29cadca82d23ae72cc890202aa86d3607aaf12aa3fffbbb1232eb0283b273166"
            },
            "downloads": -1,
            "filename": "django_neat_html-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0790f4f68dae2d90d317ce42dcb4c9f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 2492,
            "upload_time": "2024-10-14T19:44:41",
            "upload_time_iso_8601": "2024-10-14T19:44:41.178040Z",
            "url": "https://files.pythonhosted.org/packages/f5/68/a22348c4de1681760d443919e9afd1226a54e26f094161b84c21dc47fa23/django_neat_html-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-14 19:44:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "django-neat-html"
}
        
Elapsed time: 0.69757s