Metadata-Version: 2.3
Name: dj-angles
Version: 0.10.0
Summary: Add more bracket angles to Django templates </>
Project-URL: Homepage, https://github.com/adamghill/dj-angles
Project-URL: Documentation, https://github.com/adamghill/dj-angles
Project-URL: Repository, https://github.com/adamghill/dj-angles.git
Project-URL: Issues, https://github.com/adamghill/dj-angles/discussions
Project-URL: Changelog, https://github.com/adamghill/dj-angles/blob/master/CHANGELOG.md
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>
<p align="center">Add more bracket angles to Django templates</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)

- 📖 Full documentation: https://dj-angles.adamghill.com/
- 📦 Package is on PyPI: https://pypi.org/project/dj-angles/

## ⭐ Features

- Use HTML-like elements in Django templates, e.g. `<dj-partial />` instead of `{% include 'partial.html' %}`
- Wraps `include` templates in a custom element for easier debugging and targeted CSS styling
- Can be sprinkled in as needed to enhance existing Django functionality
- Since it looks like HTML, syntax highlighting mostly "just works"
- Integrates with Django component libraries like [django-bird](https://django-bird.readthedocs.io)
- Lets you excitedly tell your friends how neat the Shadow DOM is
- Pretend like you are writing React components, but without dealing with JavaScript at all

## 💥 Example

**`base.html`**

```html
<dj-block name='content'>
</dj-block name='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' %} -->

  <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 name='content'>  <!-- {% endblock content %} -->
```

**partial.html**

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

## 📖 Documentation

To learn more about how to install and use `dj-angles` go to https://dj-angles.adamghill.com/.

## ✨ Inspiration

I have been interested in Django components and encapsulating functionality for a long time (see [django-unicorn](https://www.django-unicorn.com), [dlitejs](https://dlitejs.com), etc), but had never thought of using HTML directly until I looked at [Cotton](https://django-cotton.com) by [wrabit](https://github.com/wrabit). `dj-angles` takes the initial idea further to see how well it works.
