Metadata-Version: 2.4
Name: dj-angles
Version: 0.15.0
Summary: Add more bracket angles to Django templates </>
Project-URL: Homepage, https://dj-angles.adamghill.com
Project-URL: Documentation, https://dj-angles.adamghill.com
Project-URL: Repository, https://github.com/adamghill/dj-angles.git
Project-URL: Issues, https://github.com/adamghill/dj-angles/discussions
Project-URL: Changelog, https://dj-angles.adamghill.com/en/latest/changelog.html
Author-email: Adam Hill <adam@adamghill.com>
License: MIT License
        
        Copyright (c) 2024 Adam Hill
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: brackets,django,html
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: django>=0
Requires-Dist: minestrone>=0.8.0
Provides-Extra: bird
Requires-Dist: django-bird>=0; extra == 'bird'
Provides-Extra: docs
Requires-Dist: furo>=0; extra == 'docs'
Requires-Dist: linkify-it-py>=0; extra == 'docs'
Requires-Dist: myst-parser>=0; extra == 'docs'
Requires-Dist: sphinx-autoapi>=0; extra == 'docs'
Requires-Dist: sphinx-autobuild>=0; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0; extra == 'docs'
Requires-Dist: sphinx-design>=0; extra == 'docs'
Requires-Dist: sphinx-inline-tabs>=0; extra == 'docs'
Requires-Dist: sphinx>=0; extra == 'docs'
Requires-Dist: toml>=0; extra == 'docs'
Requires-Dist: types-toml>=0; extra == 'docs'
Description-Content-Type: text/markdown

<p align="center">
  <h1 align="center">dj-angles &lt;/&gt;</h1>
</p>

![PyPI](https://img.shields.io/pypi/v/dj-angles?color=blue&style=flat-square)
![PyPI - Downloads](https://img.shields.io/pypi/dm/dj-angles?color=blue&style=flat-square)
![GitHub Sponsors](https://img.shields.io/github/sponsors/adamghill?color=blue&style=flat-square)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

- 📖 Complete documentation: https://dj-angles.adamghill.com/
- 📦 Package: https://pypi.org/project/dj-angles/

## ⭐ Features

- Use HTML-like elements in Django templates, e.g. `<dj-partial />` instead of `{% include 'partial.html' %}`
- Can be sprinkled in as needed to enhance existing Django functionality
- Since it looks like HTML, syntax highlighting mostly "just works"
- Wraps included templates in a custom element for easier debugging and targeted CSS styling
- Support for making components with the [Shadow DOM](https://dj-angles.adamghill.com/components/#CSS-scoping)
- Integrates with Django component libraries like [django-bird](https://django-bird.readthedocs.io)

## 💥 Example

**base.html**

```html
<dj-block name='content'>  <!-- {% block content %} -->
</dj-block>  <!-- {% endblock content %} -->
```

**index.html**

```html
<dj-extends parent='base.html' />  <!-- {% extends 'base.html' %} -->

<dj-block name='content'>  <!-- {% block content %} -->
  <dj-include template='partial.html' />  <!-- {% include 'partial.html' %} -->

  <div dj-if="True">  <!-- {% if True %}<div> -->
    If
  </div>
  <div dj-elif="False">  <!-- {% elif False %}<div> -->
    Elif
  </div>
  <div dj-else>  <!-- {% else %}<div> -->
    Else
  </div>  <!-- </div>{% endif %} -->

  <dj-verbatim>  <!-- {% verbatim %} -->
    This is verbatim: {% include %}
  </dj-verbatim>  <!-- {% endverbatim %} -->

  <dj-comment>  <!-- {% comment %} -->
    this is a comment
  </dj-comment>  <!-- {% endcomment %} -->

  <dj-autoescape-on>  <!-- {% autoescape-on %} -->
    This is escaped
  </dj-autoescape-on>  <!-- {% endautoescape %} -->

  <dj-autoescape-off>  <!-- {% autoescape off %} -->
    This is not escaped
  </dj-autoescape-off>  <!-- {% endautoescape %} -->

  <dj-csrf />  <!-- {% csrf_token %} -->
  
  <dj-debug />  <!-- {% debug %} -->

  <dj-image src='img/django.jpg' />  <!-- <img src="{% static 'img/django.jpg' %}" /> -->
  <dj-css href='css/styles.css' />  <!-- <link href="{% static 'css/styles.css' %}" rel="stylesheet" /> -->
</dj-block>  <!-- {% endblock content %} -->
```

**partial.html**

```html
<div>
  This is a partial: {{ now|date:"c" }}
</div>
```

## 📖 Documentation

To learn how to install and use `dj-angles` see the complete documentation at https://dj-angles.adamghill.com/.

## 🧩 Django Component Libraries

There are a growing number of component libraries for Django. A non-complete list:

- [Slippers](https://mitchel.me/slippers/): Build reusable components in Django without writing a single line of Python.
- [django-components](https://django-components.github.io/django-components/): Create simple reusable template components in Django.
- [django-template-partials](https://github.com/carltongibson/django-template-partials): Reusable named inline partials for the Django Template Language.
- [django-bird](https://django-bird.readthedocs.io): High-flying components for perfectionists with deadlines.
- [django-cotton](https://django-cotton.com): Enabling Modern UI Composition in Django.
- [django-viewcomponent](https://github.com/rails-inspire-django/django-viewcomponent): Build reusable components in Django, inspired by Rails ViewComponent.
- [django-unicorn](https://www.django-unicorn.com): The magical reactive component framework for Django ✨.

## ✨ Inspiration

- [Web Components](https://web.dev/learn/html/template)
- [django-cotton](https://django-cotton.com) by [wrabit](https://github.com/wrabit)

## 🙌 Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="http://www.levit.be"><img src="https://avatars.githubusercontent.com/u/1215070?v=4?s=100" width="100px;" alt="Emmanuelle Delescolle"/><br /><sub><b>Emmanuelle Delescolle</b></sub></a><br /><a href="https://github.com/adamghill/dj-angles/commits?author=nanuxbe" title="Code">💻</a> <a href="https://github.com/adamghill/dj-angles/commits?author=nanuxbe" title="Tests">⚠️</a> <a href="https://github.com/adamghill/dj-angles/commits?author=nanuxbe" title="Documentation">📖</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
