chore: init docs

This commit is contained in:
Gabriel Dugny 2024-04-01 14:09:17 +02:00 committed by Emil Stenström
parent 899b9a2738
commit 163b0941c2
49 changed files with 1447 additions and 9 deletions

View file

@ -1,4 +1,6 @@
# flake8: noqa F401
"""Main package for Django Components."""
import django
# Public API

View file

@ -195,10 +195,10 @@ def fill(parser: Parser, token: Token) -> FillNode:
def component(parser: Parser, token: Token, tag_name: str) -> ComponentNode:
"""
To give the component access to the template context:
{% component "name" positional_arg keyword_arg=value ... %}
```#!htmldjango {% component "name" positional_arg keyword_arg=value ... %}```
To render the component in an isolated context:
{% component "name" positional_arg keyword_arg=value ... only %}
```#!htmldjango {% component "name" positional_arg keyword_arg=value ... only %}```
Positional and keyword arguments can be literals or template variables.
The component name must be a single- or double-quotes string and must
@ -306,7 +306,7 @@ def html_attrs(parser: Parser, token: Token) -> HtmlAttrsNode:
will result in `class="my-class extra-class".
Example:
```django
```htmldjango
{% html_attrs attrs defaults:class="default-class" class="extra-class" data-id="123" %}
```
"""