Add more bracket angles to Django templates </>
Project description
dj-angles </>
- 📖 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' %}
- 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
- Lets you excitedly tell your friends how neat the Shadow DOM is
- Pretend like you are writing React components, but without dealing with a JavaScript build process
💥 Example
base.html
<dj-block name='content'> <!-- {% block content %} -->
</dj-block> <!-- {% endblock content %} -->
index.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> <!-- {% endblock content %} -->
partial.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/.
✨ Inspiration
🙌 Contributors
Emmanuelle Delescolle 💻 ⚠️ 📖 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dj_angles-0.12.0.tar.gz
(68.8 kB
view details)
Built Distribution
File details
Details for the file dj_angles-0.12.0.tar.gz
.
File metadata
- Download URL: dj_angles-0.12.0.tar.gz
- Upload date:
- Size: 68.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee937165742294916c293cf3913f28c3ad8e0cc3f249203f7bf1f07bf9f1eff2 |
|
MD5 | e50f1d335a6097bb04ac73b7a4a6e73c |
|
BLAKE2b-256 | e9142eb699b6ab4df5681ec3c6a5ff75f655208d275d1fc21ffe222a0a18fdf6 |
Provenance
The following attestation bundles were made for dj_angles-0.12.0.tar.gz
:
Publisher:
publish.yml
on adamghill/dj-angles
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dj_angles-0.12.0.tar.gz
- Subject digest:
ee937165742294916c293cf3913f28c3ad8e0cc3f249203f7bf1f07bf9f1eff2
- Sigstore transparency entry: 148276593
- Sigstore integration time:
- Predicate type:
File details
Details for the file dj_angles-0.12.0-py3-none-any.whl
.
File metadata
- Download URL: dj_angles-0.12.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dc1c8837f3c09b2111e9e92c7c344596e38f5f98ec69321affc3c98df1fb384 |
|
MD5 | 01f2f02dcb104041d3e14eb8101b313b |
|
BLAKE2b-256 | bc003fedcd6587491d1a45ff50b581c084dccfe256be2094539dea6705433f83 |
Provenance
The following attestation bundles were made for dj_angles-0.12.0-py3-none-any.whl
:
Publisher:
publish.yml
on adamghill/dj-angles
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dj_angles-0.12.0-py3-none-any.whl
- Subject digest:
0dc1c8837f3c09b2111e9e92c7c344596e38f5f98ec69321affc3c98df1fb384
- Sigstore transparency entry: 148276594
- Sigstore integration time:
- Predicate type: