Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adamghill/dj-angles

Adds more bracket angles to Django templates </>
https://github.com/adamghill/dj-angles

css django html web-components

Last synced: about 1 month ago
JSON representation

Adds more bracket angles to Django templates </>

Awesome Lists containing this project

README

        


dj-angles </>

Add more bracket angles to Django templates

![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. `` instead of `{% include 'partial.html' %}`
- Can be sprinkled in as needed and only enhances 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
- 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

```

**`index.html`**

```html



This is verbatim: {% include %}


this is a comment


This is escaped


This is not escaped






```

**partial.html**

```html


This is a partial: {{ now|date:"c" }}

```

## 📖 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.