Metadata-Version: 2.5
Name: citry-django-djc
Version: 0.1.0
Summary: Let citry-django read Django's syntax the way django-components does, so tags carrying template source as data work in both.
Project-URL: Repository, https://github.com/joeyjurjens/citry-django
Project-URL: Issues, https://github.com/joeyjurjens/citry-django/issues
Author-email: Joey Jurjens <joeyjurjens@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: citry,components,django,django-components,templates
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: citry-django
Requires-Dist: django-components>=0.140
Description-Content-Type: text/markdown

# citry-django-djc

Let [citry-django] read Django's syntax the way [django-components] does.

```bash
pip install citry-django[django-components]
```

```python
from citry import Citry
from citry_django import CitryDjangoExtension
from citry_django_djc import tokenize

app = Citry(extensions=[CitryDjangoExtension(tokenizer=tokenize)])
```

Django's own lexer ends a tag at the first `%}`, even one inside a quoted
argument. django-components replaces the tokenizer so a tag can carry template
source as data:

```django
{% component "code_block" code="{% if user %}Hi{% endif %}" %}{% endcomponent %}
```

`citry-django` claims byte ranges with whichever tokenizer it was given. Hand it
this one and the two agree; without it they disagree on where that tag ends, and
you get an error.

[citry-django]: https://github.com/joeyjurjens/citry-django
[django-components]: https://github.com/django-components/django-components
