Django-simple-components

Latest version: v0.1.0

Safety actively analyzes 623439 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.0

The syntax for describing components and usage has been changed:
- To create a closable tag, you now need to include at the beginning and / at the end before the tag name:
html
{% set_component ... %}
...
{% /set_component %}


html
{% component ... %}
...
{% /component %}

This is very similar to the endtag in Django Templates.
- Added slots. Slots are a powerful opportunity to upgrade your components! Slots can accept any content. Each slot has a name, and is specified inside the set_component tag:
html
{% set_component "card" %}
<div class="card">
<div class="card-header">
<h3>{{ title }}</h3>
</div>
<div class="card-body">
{% set_slot "body" %}
</div>
</div>
{% /set_component %}

- Inline tags can still be used, in the old syntax.

The tag engine has been completely redesigned, the context is used more and more globally.

0.0.3

Fixed bug for `{% component kwarg1="..." kwarg2="..." %}` without name with kwargs.

Added built-in Exceptions that inherit from the base `template.TemplateSyntaxError`:
- `SetComponentNameError`,
- `ComponentNameError`,
- `ComponentArgsError`,
- `ComponentNotDefined`.

Added more tests for check raise exceptions, coverage badge added.

0.0.2

Fixed bug for deploy new version to PyPI.

0.0.1

Django Simple Components is a small package to easily create components inside your templates without saving them in the templates folder.

html
{% load simple_components %}

{% set_component "first_component" %}
<div class="card">
<h3>{{ title }}</h3>
<p>{{ description }}</p>
</div>
{% end_set_component %}

<div class="card-list">
{% component "first_component" title="Hello world!" description="Some text..." %}
{% component "first_component"
title="Some lines"
description="Other text..."
%}

{% with value="this text will be capitalized later" %}
{% component "first_component" title=123 description=value|capfirst %}
{% endwith %}
</div>

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.